V
- The Class of the Value for this KeyMappublic class KeyMap<V>
extends java.lang.Object
Constructor and Description |
---|
KeyMap()
Creates a new, empty DoubleKeyMap using HashMap as the underlying Map
class for both the primary and secondary underlying Map.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the KeyMap (removes all keys and values).
|
boolean |
containsKey(java.lang.Object key)
Returns true if the KeyMap contains the given Key.
|
boolean |
containsValue(java.lang.Object value)
Returns true if the KeyMap contains the given Value.
|
V |
get(java.lang.Object key)
Returns the Value in the KeyMap for the given Key.
|
V |
getItemInOrder(int index)
Gets the Value of this KeyMap inserted as the nth element, as provided by
the given int.
|
java.lang.String |
getKeyFor(java.lang.Object key)
Returns the Key in the KeyMap for the given Value.
|
java.util.List<V> |
insertOrderValues()
Returns a Collection of the values for this KeyMap, ordered by the order
in which the Values were inserted into this KeyMap.
|
boolean |
isEmpty()
Returns true if the KeyMap is empty; false otherwise.
|
java.util.Set<java.lang.String> |
keySet()
Returns a Set of the keys for this KeyMap
Note: The returned Set is value-semantic.
|
java.util.Collection<V> |
keySortedValues()
Returns a Collection of the values for this KeyMap.
|
V |
put(java.lang.String key,
V value)
Put the given value into this KeyMap for the given key.
|
V |
remove(java.lang.Object key)
Removes the value from KeyMap for the given key.
|
int |
size()
Returns the number of entries (key-value pairs) in the KeyMap.
|
java.lang.String |
toString()
Returns a String representation of this KeyMap, primarily for purposes of
debugging.
|
public KeyMap()
public void clear()
public boolean containsKey(java.lang.Object key)
key
- the Key to be tested to determine if it is present in the
KeyMappublic boolean containsValue(java.lang.Object value)
value
- the Value to be tested to determine if it is present in the
KeyMappublic V get(java.lang.Object key)
key
- the Key for which the Value should be returnedpublic java.lang.String getKeyFor(java.lang.Object key)
key
- the Value for which the Key should be returnedpublic boolean isEmpty()
public java.util.Set<java.lang.String> keySet()
public V put(java.lang.String key, V value)
key
- The key for storing the given valuevalue
- The value to be stored for the given keypublic V remove(java.lang.Object key)
key
- The key used to identify which object to remove from thsi
KeyMappublic int size()
public java.util.Collection<V> keySortedValues()
public java.util.List<V> insertOrderValues()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public V getItemInOrder(int index)
index
- The element number used to fetch a Value from this KeyMap.