public class StateBroker
extends java.lang.Object
Constructor and Description |
---|
StateBroker()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
copyValues(StateBroker broker)
Copies only the values from the specified StateBroker to this one.
|
java.lang.Object |
getValue(java.lang.String key)
Get the value associated with the provided key.
|
java.lang.Object |
putValue(java.lang.String key,
java.lang.Object value)
Puts the value associated with the provided key in the HashMap.
|
java.lang.Object |
register(java.lang.String key,
IStateListener listener)
Registers an IStateListener to be notified if the value associated with
the key has changed.
|
void |
resetSource(java.lang.String datasource)
Resets all of the keys prefixed by the provided String.
|
void |
unregister(java.lang.String key,
IStateListener listener)
Unregisters an IStateListener so that it no longer receives notification
should a key's value change.
|
public StateBroker()
public java.lang.Object getValue(java.lang.String key)
key
- A string.public java.lang.Object putValue(java.lang.String key, java.lang.Object value)
key
- A string.value
- The new value.public void copyValues(StateBroker broker)
broker
- The StateBroker whose key-value pairs should be copied.public java.lang.Object register(java.lang.String key, IStateListener listener)
key
- A string. The value associated with this is important to the
IStateListener.listener
- The IStateListener that wants to be notified of changes to the
key's value.public void unregister(java.lang.String key, IStateListener listener)
key
- A string, the value of which is no longer important to the
listener.listener
- The IStateListener that wants to get out of notifications.public void resetSource(java.lang.String datasource)
datasource
- The data source, e.g., Input, Reference, Comparison.