net.sf.molae.pipe.comod
Class ModificationCounter

java.lang.Object
  extended by net.sf.molae.pipe.comod.ModificationCounter
All Implemented Interfaces:
ModificationMark

public final class ModificationCounter
extends Object
implements ModificationMark

Counter implementation of ModificationMark.


Method Summary
 void checkForComodification()
          Checks if the mother object has changed since the last synchronization.
 ModificationMark createChild()
          Creates a new child of this mark.
static ModificationCounter getInstance()
          Creates a new instance of this class.
 void markModification()
          Tells the modification mark that the base object has changed.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static ModificationCounter getInstance()
Creates a new instance of this class.

Returns:
a new instance of this class.

createChild

public ModificationMark createChild()
Description copied from interface: ModificationMark
Creates a new child of this mark.

Specified by:
createChild in interface ModificationMark
Returns:
a new child of this mark.

checkForComodification

public void checkForComodification()
Description copied from interface: ModificationMark
Checks if the mother object has changed since the last synchronization. If this is not a child object nothing happens.

Specified by:
checkForComodification in interface ModificationMark

markModification

public void markModification()
Description copied from interface: ModificationMark
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.

Specified by:
markModification in interface ModificationMark

toString

public String toString()
Overrides:
toString in class Object