public class TwoKeyHashMap extends AbstractMap
Modifier and Type | Class and Description |
---|---|
static class |
TwoKeyHashMap.Entry
Entry implementation for the TwoKeyHashMap class
|
Constructor and Description |
---|
TwoKeyHashMap()
Constructs an empty HashMap
|
TwoKeyHashMap(int initialCapacity)
Constructs an empty HashMap
|
TwoKeyHashMap(int initialCapacity,
float initialLoadFactor)
Constructs an empty HashMap
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the map
|
boolean |
containsKey(Object key1,
Object key2)
Answers whether this map contains a mapping for the specified keys.
|
Set |
entrySet()
Returns a collection view of the mappings
|
Object |
get(Object key1,
Object key2)
Return the value by keys
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings
|
Object |
put(Object key1,
Object key2,
Object value)
Associates the specified value with the specified keys in this map
|
Object |
remove(Object key1,
Object key2)
Removes the mapping for the keys
|
int |
size()
Returns the number of mappings
|
Collection |
values()
Returns a collection view of the values
|
clone, containsKey, containsValue, equals, get, hashCode, keySet, put, putAll, remove, toString
public TwoKeyHashMap()
public TwoKeyHashMap(int initialCapacity)
initialCapacity
- public TwoKeyHashMap(int initialCapacity, float initialLoadFactor)
initialCapacity
- initialLoadFactor
- public Collection values()
values
in interface Map
values
in class AbstractMap
public Set entrySet()
entrySet
in interface Map
entrySet
in class AbstractMap
public void clear()
clear
in interface Map
clear
in class AbstractMap
AbstractMap.isEmpty()
,
AbstractMap.size()
public Object remove(Object key1, Object key2)
key1
- key2
- public Object put(Object key1, Object key2, Object value)
key1
- key2
- value
- public boolean containsKey(Object key1, Object key2)
key1
- first keykey2
- second keypublic Object get(Object key1, Object key2)
key1
- key2
- public boolean isEmpty()
isEmpty
in interface Map
isEmpty
in class AbstractMap
true
if this map has no elements, false
otherwise.AbstractMap.size()
public int size()
size
in interface Map
size
in class AbstractMap