org.fuin.utils4j
Interface Taggable

All Known Implementing Classes:
ChangeTrackingMap, ChangeTrackingUniqueList

public interface Taggable

Something that can be tagged to memorize changes made after that point in time. It's not defined what exactly is monitored and how. This depends on the concrete implementation. This is like a kind of transaction but it has only a "rollback" (revertToTag()) but no "commit" mode. It's named Taggable to avoid confusion with database or other real transactions.


Method Summary
 boolean hasChangedSinceTagging()
          Returns if the content of the object has changed since setting the tag.
 boolean isTagged()
          Returns if the object is currently tagged.
 void revertToTag()
          Reverts all changes made since setting the tag and clears internal state.
 void tag()
          Start memorizing changes.
 void untag()
          Stop memorizing changes and clear internal state.
 

Method Detail

tag

void tag()
Start memorizing changes.


untag

void untag()
Stop memorizing changes and clear internal state. It's not reverting any change! It's simply a "forget all changes".


isTagged

boolean isTagged()
Returns if the object is currently tagged.

Returns:
If a tag is set true else false.

revertToTag

void revertToTag()
Reverts all changes made since setting the tag and clears internal state.


hasChangedSinceTagging

boolean hasChangedSinceTagging()
Returns if the content of the object has changed since setting the tag.

Returns:
If something has changed true else false.


Copyright © 2009 Future Invent Informationsmanagement GmbH. All Rights Reserved.