TKey
- The key typeTValue
- The value typepublic interface IKeyValueStore<TKey extends java.lang.Comparable<TKey>,TValue> extends ReifiedMap<TKey,TValue>
Modifier and Type | Method and Description |
---|---|
boolean |
add(TKey key,
TValue value)
Adds an item to the collection.
|
void |
clear()
Clears the collection
|
boolean |
containsKey(TKey key)
Checks if a key exists.
|
TValue |
get(TKey key)
Getter for the value associated with a key.
|
java.lang.Iterable<TKey> |
getKeys()
Returns all keys.
|
java.lang.Iterable<TValue> |
getValues()
Returns all values.
|
boolean |
remove(TKey key)
Removes an item from the collection.
|
boolean |
replace(TKey key,
TValue newValue)
Replaces a key's value with the specified new value.
|
int |
size()
Returns the collection size
|
getGenericTypeParameterKey, getGenericTypeParameterValue
boolean add(TKey key, TValue value)
key
- The key to add.value
- The value to add.java.lang.NullPointerException
- When the key is null.void clear()
boolean containsKey(TKey key)
key
- The key to find.java.lang.NullPointerException
- When the key is null.TValue get(TKey key)
java.lang.NullPointerException
- When the key is null.KeyNotFoundException
- When the key does not exist.java.lang.Iterable<TKey> getKeys()
java.lang.Iterable<TValue> getValues()
boolean remove(TKey key)
key
- The key to find.java.lang.NullPointerException
- When the key is null.boolean replace(TKey key, TValue newValue)
key
- The key to find.java.lang.NullPointerException
- When the key is null.int size()
size
in interface ReifiedMap<TKey extends java.lang.Comparable<TKey>,TValue>