sk.uniba.euromath.gene.changetracker
Interface ChangeCollector

All Known Implementing Classes:
DOMChangeCollector, ObjectChangeCollector

public interface ChangeCollector

Interface that all change collectors must implement. A change collector collects all changes performed to given source and keeps tracks of them.

Each collector should use its own means of change collection and retrieval because of very different data nature the collector may represent.

The following must held true:

Author:
Martin Vysny

Method Summary
 void clearChanges()
          Clears the change tracer.
 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 clearChanges().
 void reinit(Source source)
           Reinitializes the collector.
 

Method Detail

init

void init(Source source)

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.

Parameters:
source - the source to reinit.

reinit

void reinit(Source source)

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.

Parameters:
source -

getSource

Source getSource()

Returns a source that contains whole document.

Returns:
source containing the document.

isCompletelyChanged

boolean isCompletelyChanged()

Checks if the source object has changed completely since last call to clearChanges().

Returns:
true if the source changed as a whole, false if it changed only partially or no change occured at all.

clearChanges

void clearChanges()
Clears the change tracer.


isChanged

boolean isChanged()
Checks if this collector has captured at least one change.

Returns:
true if some changes occured, false otherwise.


Copyright 2003-2003-2006 null. All Rights Reserved.