| Modifier and Type | Field and Description |
|---|---|
static int |
INITIAL_MAP_CAPACITY |
| Constructor and Description |
|---|
StackedMap()
Constructs an empty
StackedMap. |
StackedMap(Map<? extends String,? extends Object> m)
Constructs a new
StackedMap with the same mappings as
the specified Map. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<String,Object>> |
entrySet() |
boolean |
equals(Object otherMap) |
Object |
get(Object key) |
int |
getDepth()
Returns the depth of the stack.
|
int |
hashCode() |
boolean |
isEmpty() |
Set<String> |
keySet() |
void |
pop()
Decreases the depth of the stack of maps, effectively removing all
mappings at the current level.
|
void |
push()
Increases the depth of the stack of maps.
|
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,? extends Object> m) |
Object |
remove(Object key) |
int |
size() |
String |
toString()
for debugging
|
Collection<Object> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllpublic StackedMap()
StackedMap.public StackedMap(Map<? extends String,? extends Object> m)
StackedMap with the same mappings as
the specified Map. The mappings will be created at depth
0.m - the Map whose mappings are to be placed in this
Map, cannot be null.IllegalArgumentException - if m == null.public void push()
put(String,Object) operations will store the mappings at the
higher depth.
Note that pop() will make all mappings at the current
depth unavailable.
public void pop()
put(String,Object) operations will store the mappings at the
lower depth.
Note that push() will create a higher depth.
IllegalStateException - if getDepth() == 0.public int getDepth()
public boolean containsKey(Object key)
containsKey in interface Map<String,Object>public boolean containsValue(Object value)
containsValue in interface Map<String,Object>public int hashCode()
public boolean equals(Object otherMap)
Copyright © 2010–2018. All rights reserved.