|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- the type of the keys in the mapV
- the type of the values in the mappublic interface ValueChangeMap<K,V>
A ValueMap extension which keeps track of value modifications.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jminor.common.model.valuemap.ValueMap |
---|
ValueMap.ToString<K> |
Method Summary | |
---|---|
void |
addValueListener(ActionListener valueListener)
Adds a ActionListener, this listener will be notified each time a value changes, by calling actionPerformed() with a ValueChangeEvent argument. |
ValueChangeMap<K,V> |
getCopy()
|
ValueChangeMap<K,V> |
getInstance()
|
StateObserver |
getModifiedState()
|
ValueChangeMap<K,V> |
getOriginalCopy()
|
V |
getOriginalValue(K key)
Returns the original value associated with the given key or the current value if it has not been changed. |
Collection<K> |
getOriginalValueKeys()
|
EventObserver |
getValueChangeObserver()
Returns an Event fired each time a value changes, with a ValueChangeEvent argument. |
void |
initializeValue(K key,
V value)
Initializes the value associated with the given key. |
boolean |
isModified()
|
boolean |
isModified(K key)
Returns true if the value associated with the given key has been modified.. |
void |
removeValueListener(ActionListener valueListener)
Removes the given value listener if it has been registered with this value map. |
void |
revertAll()
Reverts all value changes that have been made. |
void |
revertValue(K key)
Reverts the value associated with the given key to its original value. |
void |
saveAll()
Saves all the value changes that have been made. |
void |
saveValue(K key)
Saves the value associated with the given key, that is, removes the original value. |
void |
setAs(ValueChangeMap<K,V> sourceMap)
After a call to this method this ValueChangeMap contains the same values and original values as the given map. |
Methods inherited from interface org.jminor.common.model.valuemap.ValueMap |
---|
clear, containsValue, copyValue, getValueKeys, getValues, isValueNull, removeValue, setValue, size |
Methods inherited from interface org.jminor.common.model.valuemap.ValueProvider |
---|
getValue |
Methods inherited from interface org.jminor.common.model.valuemap.ValueAsStringProvider |
---|
getValueAsString |
Method Detail |
---|
StateObserver getModifiedState()
EventObserver getValueChangeObserver()
ValueChangeEvent
void addValueListener(ActionListener valueListener)
valueListener
- the ActionListenerValueChangeEvent
void removeValueListener(ActionListener valueListener)
valueListener
- the ActionListener to removevoid initializeValue(K key, V value)
key
- the key with which to associate the given valuevalue
- the value to associate with the given keyV getOriginalValue(K key)
key
- the key for which to retrieve the original value
boolean isModified()
boolean isModified(K key)
key
- the key
void revertValue(K key)
key
- the key for which to revert the valuevoid revertAll()
void saveValue(K key)
key
- the key for which to save the valuevoid saveAll()
ValueChangeMap<K,V> getOriginalCopy()
Collection<K> getOriginalValueKeys()
ValueChangeMap<K,V> getInstance()
ValueChangeMap<K,V> getCopy()
void setAs(ValueChangeMap<K,V> sourceMap)
sourceMap
- the map to copy or null for clearing the destination map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |