TKey
- The key typeTValue
- The value typepublic interface IBiMap<TKey extends java.lang.Comparable<TKey>,TValue extends java.lang.Comparable<TValue>> extends ReifiedMap<TKey,TValue>
Modifier and Type | Method and Description |
---|---|
boolean |
add(TKey key,
TValue value)
Adds a key/value pair in the AvlBiMap, returning true if succeeded.
|
void |
clear()
Removes all elements
|
boolean |
containsKey(TKey key)
Returns true if a given key exists, false otherwise
|
boolean |
containsValue(TValue value)
Returns true if a given value exists, false otherwise.
|
TValue |
getByKey(TKey key)
Returns the value associated with a key, if existent.
|
TKey |
getByValue(TValue value)
Returns the key associated with a value, if existent.
|
java.lang.Iterable<TKey> |
getKeys()
Returns all keys
|
java.lang.Iterable<TValue> |
getValues()
Returns all values
|
boolean |
removeByKey(TKey key)
Removes an element by its key, returns true if successful.
|
boolean |
removeByValue(TValue value)
Removes an element by its value, returns true if successful.
|
boolean |
replaceByKey(TKey key,
TValue newValue)
Replaces an element's value, searching for it by key, returns true if successful.
|
boolean |
replaceByValue(TValue value,
TKey newKey)
Replaces an element's key, searching for it by value, returns true if successful.
|
int |
size()
Returns the number of keys
|
getGenericTypeParameterKey, getGenericTypeParameterValue
java.lang.Iterable<TKey> getKeys()
java.lang.Iterable<TValue> getValues()
boolean add(TKey key, TValue value)
java.lang.NullPointerException
- When the key or the value is null.void clear()
boolean containsKey(TKey key)
java.lang.NullPointerException
- When the key is nullboolean containsValue(TValue value)
java.lang.NullPointerException
- When the value is null.TValue getByKey(TKey key)
TKey getByValue(TValue value)
boolean removeByKey(TKey key)
java.lang.NullPointerException
- When the key is null.boolean removeByValue(TValue value)
java.lang.NullPointerException
- When the value is null.boolean replaceByKey(TKey key, TValue newValue)
java.lang.NullPointerException
- When the key or the value is null.boolean replaceByValue(TValue value, TKey newKey)
java.lang.NullPointerException
- When the key or the value is null.