|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.gene.changetracker.ObjectChangeCollector
public class ObjectChangeCollector
Implements basic object change collector. Changes completely when reinitialized.
Field Summary | |
---|---|
protected boolean |
changed
If true then object was changed. |
protected ObjectSource |
source
The object source. |
Constructor Summary | |
---|---|
ObjectChangeCollector()
|
Method Summary | |
---|---|
void |
clearChanges()
Clears the change tracer. |
Object |
getChanges()
Returns changes. |
Source |
getSource()
Returns a source that contains whole document. |
void |
init(Source source)
Initializes the collector with given source. |
boolean |
isChanged()
Checks if this collector has captured at least one change. |
boolean |
isCompletelyChanged()
Checks if the source object has changed completely since last call to ChangeCollector.clearChanges() . |
void |
reinit(Source source)
Reinitializes the collector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ObjectSource source
protected boolean changed
true
then object was changed.
Constructor Detail |
---|
public ObjectChangeCollector()
Method Detail |
---|
public void init(Source source)
ChangeCollector
Initializes the collector with given source. Implementors must act as if
whole document was changed. Implementor should clone the
source
object if it intends to keep it.
Must be called exactly once as the first method.
init
in interface ChangeCollector
source
- the source to reinit.public void reinit(Source source)
ChangeCollector
Reinitializes the collector. The collector may act as if whole source was changed, or it may compare new source to previous source and reinitialize the list of changes.
May be called multiple times.
reinit
in interface ChangeCollector
public Source getSource()
ChangeCollector
Returns a source that contains whole document.
getSource
in interface ChangeCollector
public boolean isCompletelyChanged()
ChangeCollector
Checks if the source object has changed completely since last call to
ChangeCollector.clearChanges()
.
isCompletelyChanged
in interface ChangeCollector
true
if the source changed as a whole,
false
if it changed only partially or no change occured at
all.public void clearChanges()
ChangeCollector
clearChanges
in interface ChangeCollector
public boolean isChanged()
ChangeCollector
isChanged
in interface ChangeCollector
true
if some changes occured, false
otherwise.public Object getChanges()
getSource().getObject()
or
null
if no changes are available.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |