net.sf.molae.pipe.comod
Interface ModificationMark

All Known Implementing Classes:
DummyMark, ModificationCounter

public interface ModificationMark

A modification mark is used to check if an object was modified since the last synchronization. This is typically a counter or a timestamp.
Handling is as follows:

This interface is the solution of the problem to find a representation of AbstractList.modCount that can be interchanged between independent classes.

A note on equals:
Objects of this types are no value objects: Two counters are still different, although they may have the same state. Therefore it is recommended that the Object implementation of equals() is not overwritten.


Method Summary
 void checkForComodification()
          Checks if the mother object has changed since the last synchronization.
 ModificationMark createChild()
          Creates a new child of this mark.
 void markModification()
          Tells the modification mark that the base object has changed.
 

Method Detail

createChild

ModificationMark createChild()
Creates a new child of this mark.

Returns:
a new child of this mark.

checkForComodification

void checkForComodification()
Checks if the mother object has changed since the last synchronization. If this is not a child object nothing happens.

Throws:
ConcurrentModificationException - if the mother object has changed since the last synchronization.

markModification

void markModification()
Tells the modification mark that the base object has changed. If the implementing object is a child of another ModificationMark, it copies the state of the mother object. If it is a top level object (not a child) it creates a new unique state.