public abstract class AbstractChangeTracker extends Object implements ChangeTracker
Modifier and Type | Field and Description |
---|---|
protected Collection |
add
Collection of added items.
|
protected Collection |
change
Collection of changed items.
|
protected Collection |
rem
Collection of removed items.
|
Constructor and Description |
---|
AbstractChangeTracker()
Constructor; supply configuration.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
add(Object val)
Mark the given value as added.
|
protected void |
added(Object val)
Notify the tracker that the given object was added.
|
protected abstract void |
change(Object val)
Mark the given value as changed.
|
protected void |
changed(Object val)
Notify the tracker that the given object was changed.
|
Collection |
getAdded()
Return the collection of values that need to be added to the managed
container.
|
boolean |
getAutoOff()
Whether to automatically stop tracking when the number of changes
exceeds the container size.
|
Collection |
getChanged()
Return the set of elements that have changed.
|
int |
getNextSequence()
The next element sequence value for this proxy at load time.
|
Collection |
getRemoved()
Return the set of values that need to be removed from the managed
container.
|
protected int |
initialSequence()
Return the initial sequence value for this proxy.
|
boolean |
isTracking()
Return true if this tracker has an up-to-date view of all the changes
to the container it is managing.
|
protected Set |
newSet()
Create a new set for storing adds/removes/changes.
|
protected abstract void |
remove(Object val)
Mark the given value as removed.
|
protected void |
removed(Object val)
Notify the tracker that the given object was removed.
|
protected void |
reset()
Reset the state of the tracker.
|
void |
setAutoOff(boolean autoOff)
Whether to automatically stop tracking when the number of changes
exceeds the container size.
|
void |
setNextSequence(int seq)
The maximum element sequence value for this proxy at load time.
|
void |
startTracking()
Reset the state of the change tracker, and turn change tracking back
on if it has been disabled.
|
void |
stopTracking()
Tell the tracker to stop tracking changes for its container.
|
protected Collection add
protected Collection rem
protected Collection change
public AbstractChangeTracker()
public boolean getAutoOff()
public void setAutoOff(boolean autoOff)
public boolean isTracking()
ChangeTracker
isTracking
in interface ChangeTracker
public void startTracking()
ChangeTracker
startTracking
in interface ChangeTracker
protected int initialSequence()
public void stopTracking()
ChangeTracker
stopTracking
in interface ChangeTracker
protected void reset()
public Collection getAdded()
ChangeTracker
getAdded
in interface ChangeTracker
public Collection getRemoved()
ChangeTracker
getRemoved
in interface ChangeTracker
public Collection getChanged()
ChangeTracker
getChanged
in interface ChangeTracker
protected void added(Object val)
protected abstract void add(Object val)
protected void removed(Object val)
protected abstract void remove(Object val)
protected void changed(Object val)
protected abstract void change(Object val)
public int getNextSequence()
ChangeTracker
getNextSequence
in interface ChangeTracker
public void setNextSequence(int seq)
ChangeTracker
setNextSequence
in interface ChangeTracker
protected Set newSet()
Copyright © 2006–2017 Apache Software Foundation. All rights reserved.