public interface ISharedHashtable<TKey extends java.lang.Comparable<TKey>,TValue> extends ReifiedMap<TKey,TValue>, IShared
Modifier and Type | Method and Description |
---|---|
boolean |
add(TKey key,
TValue value)
Adds a new key/value pair.
|
java.lang.Iterable<java.lang.Boolean> |
addRange(java.lang.Iterable<? extends TKey> keys,
java.lang.Iterable<? extends TValue> values)
Bulk add key/value pairs to avoid locking/unlocking continuously.
|
void |
clear()
Removes all keys and values.
|
boolean |
contains(TKey key)
Returns the value of a key, if found.
|
TValue |
get(TKey key)
Returns the key's value if it exists, otherwise throws KeyNotFoundException.
|
TValue |
get(TKey key,
TValue nullValue)
Returns the value of a key, if found.
|
ReifiedIterable<TKey> |
getKeys()
Returns a copy of all keys
|
ReifiedIterable<TValue> |
getValues()
Returns a copy of all values
|
boolean |
remove(TKey key)
Removes a value by its key.
|
TValue |
removeAndGet(TKey key,
TValue nullValue)
Removes a value by its key and returns it.
|
java.lang.Iterable<java.lang.Boolean> |
removeRange(java.lang.Iterable<? extends TKey> keys)
Removes a number of elements by key.
|
boolean |
replace(TKey key,
TValue newValue)
Replaces a key's value, returning true if this was successful.
|
java.lang.Iterable<java.lang.Boolean> |
replaceAll(java.lang.Iterable<? extends TKey> keys,
java.lang.Iterable<? extends TValue> values)
Clears the hashtable and bulk adds key/value pairs to avoid locking/unlocking continuously.
|
int |
size()
Returns size of hashtable
|
getGenericTypeParameterKey, getGenericTypeParameterValue
boolean add(TKey key, TValue value)
java.lang.NullPointerException
- When the key is null.java.lang.Iterable<java.lang.Boolean> addRange(java.lang.Iterable<? extends TKey> keys, java.lang.Iterable<? extends TValue> values)
java.lang.NullPointerException
- When the keys or the values argument is null.java.lang.IllegalArgumentException
- When the keys and values collections do not have the same size.void clear()
boolean contains(TKey key)
java.lang.NullPointerException
- When the key is null.TValue get(TKey key)
java.lang.NullPointerException
- When the key is null.KeyNotFoundException
- When the key was not found.TValue get(TKey key, TValue nullValue)
java.lang.NullPointerException
- When the key is null.ReifiedIterable<TKey> getKeys()
ReifiedIterable<TValue> getValues()
boolean remove(TKey key)
java.lang.NullPointerException
- When the key is null.TValue removeAndGet(TKey key, TValue nullValue)
java.lang.NullPointerException
- When the key is null.java.lang.Iterable<java.lang.Boolean> removeRange(java.lang.Iterable<? extends TKey> keys)
java.lang.NullPointerException
- When the keys is null.boolean replace(TKey key, TValue newValue)
java.lang.NullPointerException
- When the key is null.java.lang.Iterable<java.lang.Boolean> replaceAll(java.lang.Iterable<? extends TKey> keys, java.lang.Iterable<? extends TValue> values)
java.lang.NullPointerException
- When the keys or the values argument is null.java.lang.IllegalArgumentException
- When the keys and values collections do not have the same size.int size()
size
in interface ReifiedMap<TKey extends java.lang.Comparable<TKey>,TValue>