public class StackHashMap<K,V> extends Object implements ConcurrentMap<K,V>
LinkedHashMap
that provides predictable iteration order. All the operations that require thread safety are
protected by the lock of synchronized map.| Constructor and Description |
|---|
StackHashMap() |
| Modifier and Type | Method and Description |
|---|---|
Map<K,V> |
asMap() |
List<K> |
asStack() |
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
peek() |
K |
peekKey() |
V |
pop()
Removes the first value from the map
|
V |
push(K k,
V v) |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
putIfAbsent(K k,
V v)
Puts a key to top of the map if absent if the key is present in stack it is removed
|
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
int |
size() |
Collection<V> |
values() |
public boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public V pop()
public V peek()
public K peekKey()
public List<K> asStack()
public V putIfAbsent(K k, V v)
putIfAbsent in interface ConcurrentMap<K,V>public boolean remove(Object key, Object value)
remove in interface ConcurrentMap<K,V>public boolean replace(K key, V oldValue, V newValue)
replace in interface ConcurrentMap<K,V>Copyright © 2013. All Rights Reserved.