K - key typeV - value typepublic class OrderedIndex<K,V> extends java.lang.Object implements Index<K,V>
| Constructor and Description |
|---|
OrderedIndex() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<V> |
find(K key)
Finds all values indexed by the given key.
|
void |
forEachValue(Consumer<V> consumer)
Iterates over each value indexed by this index.
|
java.util.Set<K> |
getKeys()
Retrieves the set of all keys.
|
void |
put(K key,
V value)
Adds a value to the index, for the given key.
|
void |
remove(K key,
V value)
Removes a value from the index, for the given key.
|
public void put(K key, V value)
key - keyvalue - valuepublic void remove(K key, V value)
key - keyvalue - valuepublic java.util.List<V> find(K key)
Indexpublic java.util.Set<K> getKeys()
Index