public class SubclassifiedIndex<K,V>
extends java.lang.Object
- adding a key inherits from super-class - adding values applies to all sub-classes - removing values applies to all sub-classes
Currently this class is only used to keep the tree and return changed key- value-sets upon modification, since looking up the keys in an external cache, e.g. HashMap, is faster than tree traversal which must use linear scan at each level. Therefore, no value traversals are published.
Modifier and Type | Class and Description |
---|---|
static class |
SubclassifiedIndex.Nonroot<K,V> |
Constructor and Description |
---|
SubclassifiedIndex(Subclassification<K> sc) |
Modifier and Type | Method and Description |
---|---|
scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> |
addKey(K key)
Add key to this index which inherits its value set from the most specific
super-class which is known.
|
scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> |
addValue(K key,
V value)
Add value to all keys which are subclasses of the given key.
|
static <K,V> scala.collection.immutable.Map<K,scala.collection.immutable.Set<V>> |
emptyMergeMap() |
protected scala.collection.immutable.Set<K> |
findSubKeysExcept(K key,
scala.collection.immutable.Vector<SubclassifiedIndex.Nonroot<K,V>> except)
Find all subkeys of a given key in the index excluding some subkeys.
|
protected scala.collection.immutable.Set<V> |
findValues(K key)
Find all values for a given key in the index.
|
protected scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> |
innerAddKey(K key) |
protected scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> |
innerAddValue(K key,
V value) |
protected scala.collection.immutable.Set<K> |
innerFindSubKeys(K key,
scala.collection.immutable.Vector<SubclassifiedIndex.Nonroot<K,V>> except) |
protected scala.collection.immutable.Set<V> |
innerFindValues(K key) |
protected scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> |
innerRemoveValue(K key,
V value) |
scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> |
removeValue(K key,
V value)
Remove value from all keys which are subclasses of the given key.
|
scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> |
removeValue(V value)
Remove value from all keys in the index.
|
protected SubclassifiedIndex<K,V> |
root() |
protected scala.collection.immutable.Vector<SubclassifiedIndex.Nonroot<K,V>> |
subkeys() |
java.lang.String |
toString() |
protected scala.collection.immutable.Set<V> |
values() |
public SubclassifiedIndex(Subclassification<K> sc)
public static <K,V> scala.collection.immutable.Map<K,scala.collection.immutable.Set<V>> emptyMergeMap()
protected scala.collection.immutable.Set<V> values()
protected scala.collection.immutable.Vector<SubclassifiedIndex.Nonroot<K,V>> subkeys()
protected SubclassifiedIndex<K,V> root()
public scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> addKey(K key)
key
- (undocumented)protected scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> innerAddKey(K key)
public scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> addValue(K key, V value)
key
- (undocumented)value
- (undocumented)protected scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> innerAddValue(K key, V value)
public scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> removeValue(K key, V value)
key
- (undocumented)value
- (undocumented)protected scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> innerRemoveValue(K key, V value)
public scala.collection.immutable.Seq<scala.Tuple2<K,scala.collection.immutable.Set<V>>> removeValue(V value)
value
- (undocumented)protected final scala.collection.immutable.Set<V> findValues(K key)
key
- (undocumented)protected final scala.collection.immutable.Set<K> findSubKeysExcept(K key, scala.collection.immutable.Vector<SubclassifiedIndex.Nonroot<K,V>> except)
key
- (undocumented)except
- (undocumented)protected scala.collection.immutable.Set<K> innerFindSubKeys(K key, scala.collection.immutable.Vector<SubclassifiedIndex.Nonroot<K,V>> except)
public java.lang.String toString()
toString
in class java.lang.Object