K
- The key to use in the mapV
- The value to put in the dequepublic class DequeMap<K,V> extends Object
Constructor and Description |
---|
DequeMap()
Constructs an empty DequeMap with the default initial capacities
(3 and 3) and the default map load factor (0.75).
|
DequeMap(int initialMapCapacity,
int initialDequeCapacity)
Constructs an empty DequeMap with the specified initial capacities
and the default map load factor (0.75).
|
Modifier and Type | Method and Description |
---|---|
void |
add(K key,
V value)
Add a value for a key to the map.
|
V |
get(K key)
Get the most recent value for a key.
|
boolean |
isEmpty()
Returns true if no mappings are defined.
|
V |
remove(K key)
Remove the most recent value for a key.
|
public DequeMap()
public DequeMap(int initialMapCapacity, int initialDequeCapacity)
initialMapCapacity
- the initial map capacity.initialDequeCapacity
- the initial deque capacity.IllegalArgumentException
- if the initial capacity is negative.public void add(K key, V value)
key
- key with which the specified value is to be associatedvalue
- the value to push for the keypublic V get(K key)
key
- key to getpublic V remove(K key)
key
- key to getpublic boolean isEmpty()
Copyright © 2018. All rights reserved.