|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.util.MapWrapper
org.pf.util.StackedMap
public class StackedMap
Provides a map that allows to push() and pop() internal settings to/from a (LIFO) stack. Accessing an element via get(key) always looks in the last map and then continues looking for it (if not found) in the next map on the stack.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
StackedMap()
Initialize the new instance with default values. |
|
StackedMap(java.util.Map map)
Initialize the new instance with an internal map. |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all entries from this map, but not from the maps on the stack! |
boolean |
containsKey(java.lang.Object key)
This method returns true, if the given key can be found in this map or any map on the stack. |
boolean |
containsValue(java.lang.Object value)
This method returns true, if the given value is a value of any entry in this map or any map on the stack. |
java.util.Set |
entrySet()
Returns all entries of the map and all stacked maps. |
java.lang.Object |
get(java.lang.Object key)
Returns the object that was registered under the specified key in this map or in any of the maps on the stack. |
boolean |
isEmpty()
Returns true, if there is no entry in this map and in all maps on the stack. |
java.util.Set |
keySet()
Returns all keys in this map and the maps on the stack |
java.util.Map |
pop()
Removes the map at the top of this stack and returns that map as the value of this function. |
void |
push()
Pushes the an newly created map onto the top of this stack. |
void |
push(java.util.Map map)
Pushes the given map onto the top of this stack. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts the given value under the specified key into this map. |
void |
putAll(java.util.Map map)
Each entry of the given map will be added to this map. |
java.lang.Object |
remove(java.lang.Object key)
Removes the entry with the specified key from this map. |
int |
size()
Returns how many entries currently are in this map and the maps on the stack. |
java.util.Collection |
values()
Returns all values of this map and the maps on the stack. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public StackedMap()
public StackedMap(java.util.Map map)
| Method Detail |
|---|
public void clear()
clear in interface java.util.Mapclear in class MapWrapperMap.clear()public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.MapcontainsKey in class MapWrapperMap.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.MapcontainsValue in class MapWrapperMap.containsValue(Object)public java.util.Set entrySet()
entrySet in interface java.util.MapentrySet in class MapWrapperMap.entrySet()public java.lang.Object get(java.lang.Object key)
get in interface java.util.Mapget in class MapWrapperMap.get(Object)public boolean isEmpty()
isEmpty in interface java.util.MapisEmpty in class MapWrapperMap.isEmpty()public java.util.Set keySet()
keySet in interface java.util.MapkeySet in class MapWrapperMap.keySet()
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in class MapWrapperMap.put(Object, Object)public void putAll(java.util.Map map)
putAll in interface java.util.MapputAll in class MapWrapperMap.putAll(Map)public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in class MapWrapperMap.remove(Object)public int size()
size in interface java.util.Mapsize in class MapWrapperMap.size()public java.util.Collection values()
values in interface java.util.Mapvalues in class MapWrapperMap.values()public void push(java.util.Map map)
public void push()
public java.util.Map pop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||