public interface Index<V>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all key-value associations.
|
Set<V> |
getAll(String key)
Returns a
Set of all values associated with a key. |
boolean |
isEmpty()
Returns
true if no key-value associations exist. |
boolean |
put(String key,
V value)
Associates a single value with a key.
|
boolean |
putAll(String key,
Collection<V> values)
Associates a collection of values with a key.
|
boolean |
remove(String key,
V value)
Removes a single value associated with a key.
|
boolean |
remove(V value)
Removes a single value associated with any keys.
|
boolean |
removeAll(Collection<V> values)
Removes a collection of values associated with any keys.
|
Set<V> |
removeAll(String key)
Removes all values associated with a key.
|
boolean |
removeAll(String key,
Collection<V> values)
Removes a collection of values associated with a key.
|
int |
size()
Returns the number of key-value associations.
|
void clear()
Set<V> getAll(String key)
Set
of all values associated with a key.NullPointerException
- if key
is null;boolean isEmpty()
true
if no key-value associations exist.boolean put(String key, @Nullable V value)
NullPointerException
- if key
is null;boolean putAll(String key, Collection<V> values)
NullPointerException
- if key
or values
are null;boolean remove(String key, @Nullable V value)
NullPointerException
- if key
is null;boolean removeAll(Collection<V> values)
NullPointerException
- if values
is null;Set<V> removeAll(String key)
NullPointerException
- if key
is null;boolean removeAll(String key, Collection<V> values)
NullPointerException
- if key
or values
are null;int size()
Copyright © 2017. All rights reserved.