public class Index<K,V>
extends java.lang.Object
Constructor and Description |
---|
Index(int mapSize,
java.util.Comparator<V> valueComparator) |
Index(int mapSize,
scala.Function2<V,V,java.lang.Object> cmp) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all keys and all values
|
scala.Option<V> |
findValue(K key,
scala.Function1<V,java.lang.Object> f) |
void |
foreach(scala.Function2<K,V,scala.runtime.BoxedUnit> fun)
Applies the supplied function to all keys and their values
|
boolean |
isEmpty() |
scala.collection.Iterable<K> |
keys()
Returns the key set.
|
int |
mapSize() |
boolean |
put(K key,
V value)
Associates the value of type V with the key of type K
|
scala.Option<scala.collection.Iterable<V>> |
remove(K key)
Disassociates all the values for the specified key
|
boolean |
remove(K key,
V value)
Disassociates the value of type V from the key of type K
|
void |
removeValue(V value)
Removes the specified value from all keys
|
java.util.Comparator<V> |
valueComparator() |
scala.collection.Iterator<V> |
valueIterator(K key)
Returns an Iterator of V containing the values for the supplied key, or an empty iterator if the key doesn't exist
|
scala.collection.immutable.Set<V> |
values()
Returns the union of all value sets.
|
public Index(int mapSize, java.util.Comparator<V> valueComparator)
public int mapSize()
public java.util.Comparator<V> valueComparator()
public boolean put(K key, V value)
key
- (undocumented)value
- (undocumented)public scala.Option<V> findValue(K key, scala.Function1<V,java.lang.Object> f)
key
- (undocumented)f
- (undocumented)public scala.collection.Iterator<V> valueIterator(K key)
key
- (undocumented)public void foreach(scala.Function2<K,V,scala.runtime.BoxedUnit> fun)
fun
- (undocumented)public scala.collection.immutable.Set<V> values()
public scala.collection.Iterable<K> keys()
public boolean remove(K key, V value)
key
- (undocumented)value
- (undocumented)public scala.Option<scala.collection.Iterable<V>> remove(K key)
key
- (undocumented)public void removeValue(V value)
value
- (undocumented)public boolean isEmpty()
public void clear()