|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MapDiff
A map that is represented as a set of changes to some underlying map.
A MapDiff object can be modified, but changes to the MapDiff do not
affect the underlying map unless changeUnderlyingMap
is
called. The advantages of using a MapDiff rather than creating another
Map object are:
A MapDiff behaves correctly if entries are placed in the underlying map after the MapDiff is created. It also behaves correctly if entries are removed from the underlying map, as long as those keys have not also been removed from the MapDiff (then they may be double-counted).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Method Summary | |
---|---|
void |
changeUnderlying()
Changes the underlying map so it is equal to this map. |
void |
clearChanges()
Resets this map so it is equal to the underlying map. |
java.util.Set |
getChangedKeys()
Returns the set of keys that map to different values in this map than in the underlying map. |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Method Detail |
---|
java.util.Set getChangedKeys()
The returned set may or may not be kept up to date as changes are made to this MapDiff.
void changeUnderlying()
java.lang.UnsupportedOperationException
- if the underlying map is
not modifiablevoid clearChanges()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |