|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
edu.stanford.nlp.util.DeltaMap
A Map which wraps an original Map, and only stores the changes (deltas) from the original Map. This increases Map access time (roughly doubles it) but eliminates Map creation time and decreases memory usage (if you're keeping the original Map in memory anyway). User: Teg Grenager Date: Jan 9, 2004 Time: 9:19:06 AM
Nested Class Summary |
Nested classes inherited from class java.util.Map |
Map.Entry |
Constructor Summary | |
DeltaMap(Map originalMap)
|
|
DeltaMap(Map originalMap,
MapFactory mf)
This is very cheap. |
Method Summary | |
void |
clear()
This is more expensive than normal. |
boolean |
containsKey(Object key)
This is expensive. |
Set |
entrySet()
This is cheap. |
Object |
get(Object key)
This may cost twice what it would in the original Map. |
static void |
main(String[] args)
For testing only. |
Object |
put(Object key,
Object value)
This may cost twice what it would in the original Map because we have to find the original value for this key. |
Object |
remove(Object key)
|
Methods inherited from class java.util.AbstractMap |
clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
containsValue, equals, hashCode, isEmpty, keySet, putAll, size, values |
Constructor Detail |
public DeltaMap(Map originalMap, MapFactory mf)
originalMap
- will serve as the basis for this DeltaMappublic DeltaMap(Map originalMap)
Method Detail |
public boolean containsKey(Object key)
containsKey
in interface Map
key
- key whose presence in this map is to be tested.
public Object get(Object key)
get
in interface Map
key
- key whose associated value is to be returned.
public Object put(Object key, Object value)
put
in interface Map
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
public Object remove(Object key)
remove
in interface Map
public void clear()
clear
in interface Map
public Set entrySet()
entrySet
in interface Map
public static void main(String[] args)
args
- from command line
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |