TKey
- The key typeTValue
- The value typepublic interface IListMap<TKey extends java.lang.Comparable<TKey>,TValue> extends ReifiedMap<TKey,TValue>
Modifier and Type | Method and Description |
---|---|
boolean |
add(KeyValuePair<? extends TKey,? extends TValue> kvp)
Adds a new key/value pair.
|
boolean |
add(TKey key,
TValue value)
Adds a new key/value pair.
|
void |
clear()
Removes all keys and values.
|
boolean |
contains(TKey key)
Returns true if the given key is contained in the collection.
|
TValue |
get(TKey key)
Returns the key's value if it exists, otherwise throws KeyNotFoundException.
|
TValue |
getAt(int index)
Returns the key's value if the position exists.
|
java.lang.Iterable<TKey> |
getKeys()
Returns all keys in ascending key order.
|
java.lang.Iterable<TValue> |
getValues()
Returns all values.
|
int |
indexOf(TKey key)
Returns the index of the given key, if it is contained in the collection.
|
boolean |
remove(TKey key)
Removes an item from the collection.
|
void |
removeAt(int index)
Removes an item from the collection.
|
boolean |
replace(TKey key,
TValue newValue)
Replaces a key's value with the specified new value.
|
void |
replaceAt(int index,
TValue value)
Sets a value at the specified index.
|
int |
size()
Returns the number of elements in the collection.
|
getGenericTypeParameterKey, getGenericTypeParameterValue
boolean add(TKey key, TValue value)
java.lang.NullPointerException
- If the key is null.boolean add(KeyValuePair<? extends TKey,? extends TValue> kvp)
java.lang.NullPointerException
- If the key/value pair or the key is null.void clear()
boolean contains(TKey key)
java.lang.NullPointerException
- If the key is null.TValue get(TKey key)
java.lang.NullPointerException
- The argument provided was null.KeyNotFoundException
- The key was not found.TValue getAt(int index)
java.lang.IndexOutOfBoundsException
- The argument provided was out of range.java.lang.Iterable<TKey> getKeys()
java.lang.Iterable<TValue> getValues()
int indexOf(TKey key)
java.lang.NullPointerException
- If the key is null.boolean remove(TKey key)
java.lang.NullPointerException
- If the key is null.void removeAt(int index)
java.lang.NullPointerException
- If the index is out of range.boolean replace(TKey key, TValue newValue)
java.lang.NullPointerException
- If the key is null.void replaceAt(int index, TValue value)
java.lang.IndexOutOfBoundsException
- The index provided was out of range.int size()
size
in interface ReifiedMap<TKey extends java.lang.Comparable<TKey>,TValue>