StateTrackable interface with implementations
of the required methods in the interface and methods to manage
transitions in the state of the object.
Classes which wish to implement StateTrackable could create an
instance of this class and delegate all of their implementations
for StateTrackable methods to the corresponding methods
of this class.
| Modifier and Type | Field and Description |
|---|---|
| public static final StateTrackableDelegate | IMMUTABLE_DELEGATE
The |
| private int | |
| private StateTrackable. | |
| pack-priv StateTracker | |
| public static final StateTrackableDelegate | UNTRACKABLE_DELEGATE
The |
| Access | Constructor and Description |
|---|---|
| private | StateTrackableDelegate(StateTrackable.
Constructs a StateTrackableDelegate object with the specified initial State. |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | addDynamicAgent()
This method provides an easy way for delegating classes to
manage temporarily setting the overall |
| public static StateTrackableDelegate | createInstance(StateTrackable.
Returns a |
| public StateTrackable. | getState()
Implements sun. Returns the general state of the complex data held by this object. |
| public synchronized StateTracker | getStateTracker()
Implements sun. Returns an object which can track future changes to the complex data stored in this object. |
| public void | markDirty()
This method provides an easy way for delegating classes to indicate that the contents have changed. |
| protected synchronized void | removeDynamicAgent()
This method provides an easy way for delegating classes to
manage restoring the overall |
| public synchronized void | setImmutable()
This method provides an easy way for delegating classes to
change the overall |
| public synchronized void | setUntrackable()
This method provides an easy way for delegating classes to
change the overall |
| IMMUTABLE_DELEGATE | back to summary |
|---|---|
| public static final StateTrackableDelegate IMMUTABLE_DELEGATE The | |
| numDynamicAgents | back to summary |
|---|---|
| private int numDynamicAgents | |
| theState | back to summary |
|---|---|
| private StateTrackable. | |
| theTracker | back to summary |
|---|---|
| pack-priv StateTracker theTracker | |
| UNTRACKABLE_DELEGATE | back to summary |
|---|---|
| public static final StateTrackableDelegate UNTRACKABLE_DELEGATE The | |
| StateTrackableDelegate | back to summary |
|---|---|
| private StateTrackableDelegate(StateTrackable. Constructs a StateTrackableDelegate object with the specified initial State. | |
| addDynamicAgent | back to summary |
|---|---|
| public synchronized void addDynamicAgent() This method provides an easy way for delegating classes to
manage temporarily setting the overall
The companion method
This method will only change the
| |
| createInstance | back to summary |
|---|---|
| public static StateTrackableDelegate createInstance(StateTrackable. Returns a | |
| getState | back to summary |
|---|---|
| public StateTrackable. Implements sun. Doc from sun. Returns the general state of the complex data held by this object. This return value can be used to determine if it makes strategic sense to try and cache information about the current contents of this object. The StateTracker returned from the getStateTracker() method will further aid in determining when the data has been changed so that the caches can be verified upon future uses.
| |
| getStateTracker | back to summary |
|---|---|
| public synchronized StateTracker getStateTracker() Implements sun. Doc from sun. Returns an object which can track future changes to the
complex data stored in this object.
If an external agent caches information about the complex
data of this object, it should first get a StateTracker
object from this method so that it can check if such
information is current upon future uses.
Note that a valid StateTracker will always be returned
regardless of the return value of getState(), but in some
cases the StateTracker may be a trivial implementation
which always returns the same value from its
| |
| markDirty | back to summary |
|---|---|
| public void markDirty() This method provides an easy way for delegating classes to indicate that the contents have changed. This method will invalidate outstanding StateTracker objects so that any other agents which maintain cached information about the pixels will know to refresh their cached copies. This method should be called after every modification to the data, such as any calls to any of the setElem methods.
Note that, for efficiency, this method does not check the
| |
| removeDynamicAgent | back to summary |
|---|---|
| protected synchronized void removeDynamicAgent() This method provides an easy way for delegating classes to
manage restoring the overall
The companion method
This method will only change the
| |
| setImmutable | back to summary |
|---|---|
| public synchronized void setImmutable() This method provides an easy way for delegating classes to
change the overall
| |
| setUntrackable | back to summary |
|---|---|
| public synchronized void setUntrackable() This method provides an easy way for delegating classes to
change the overall
| |