Package org.aksw.commons.index.core
Class StorageNodeAltBase<D,C,V>
- java.lang.Object
-
- org.aksw.commons.index.core.StorageNodeBase<D,C,V>
-
- org.aksw.commons.index.core.StorageNodeAltBase<D,C,V>
-
- Type Parameters:
D-C-V-
- All Implemented Interfaces:
StorageNode<D,C,V>
- Direct Known Subclasses:
StorageNodeAlt2,StorageNodeAlt3,StorageNodeAltN
public abstract class StorageNodeAltBase<D,C,V> extends StorageNodeBase<D,C,V>
Base class for index nodes that do not index by a key - or rather: index by a single key that is a zero-sized tuple- Author:
- Claus Stadler 11/09/2020
-
-
Field Summary
-
Fields inherited from class org.aksw.commons.index.core.StorageNodeBase
tupleAccessor, tupleIdxs
-
-
Constructor Summary
Constructors Constructor Description StorageNodeAltBase(org.aksw.commons.tuple.TupleAccessor<D,C> tupleAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CgetKeyComponentRaw(Object key, int idx)Obtain components from the internal representation of key that was used for indexing w.r.t.booleanisAltNode()Whether this storage node stores are a sequences of alternatives Experimental method; may be replaced by a generic getStoreType() method that returns e.g Alt.class, Set.class, etc.<T> Streamer<V,? extends Map.Entry<?,?>>streamerForKeyAndSubStoreAlts(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)Stream a single entry of the store alts themselves children can then pick an alternative based on their index<T> Streamer<V,?>streamerForKeys(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)<T> Streamer<V,C>streamerForKeysAsComponent(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)Compiles from a given pattern a function that can stream the matching keys from the appropriate store.<T> Streamer<V,List<C>>streamerForKeysAsTuples(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)Compiles from a given pattern a function that can stream the matching keys from the appropriate store.<T> Streamer<V,V>streamerForValues(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)Returns an object that can extract the stream of values at an index node under constraints map: { entry.value | entry in map and entry.key matches condition} leafSet: set.entries.stream() A leaf set does not have any keys that could affect the result stream-
Methods inherited from class org.aksw.commons.index.core.StorageNodeBase
getKeyTupleIdxs, getTupleAccessor
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.aksw.commons.index.core.StorageNode
chooseSubStore, chooseSubStoreRaw, getChildren, getPublicDelegate, getStoreAsList, getStoreAsMap, getStoreAsSet, holdsDomainTuples, isDelegate, isListNode, isMapNode, isSetNode, streamEntries, streamEntries, streamEntriesRaw, streamEntriesRaw
-
-
-
-
Method Detail
-
isAltNode
public boolean isAltNode()
Description copied from interface:StorageNodeWhether this storage node stores are a sequences of alternatives Experimental method; may be replaced by a generic getStoreType() method that returns e.g Alt.class, Set.class, etc.- Returns:
-
streamerForKeysAsComponent
public <T> Streamer<V,C> streamerForKeysAsComponent(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)
Description copied from interface:StorageNodeCompiles from a given pattern a function that can stream the matching keys from the appropriate store. The keys must be instances of the component type otherwise an exception is raised- Returns:
-
streamerForKeysAsTuples
public <T> Streamer<V,List<C>> streamerForKeysAsTuples(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)
Description copied from interface:StorageNodeCompiles from a given pattern a function that can stream the matching keys from the appropriate store. The keys must be instances of the component type otherwise an exception is raised if getKeyTupleIdxs().length == 0 then returns a single tuple that projects no components- Returns:
-
streamerForValues
public <T> Streamer<V,V> streamerForValues(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)
Description copied from interface:StorageNodeReturns an object that can extract the stream of values at an index node under constraints map: { entry.value | entry in map and entry.key matches condition} leafSet: set.entries.stream() A leaf set does not have any keys that could affect the result stream- Returns:
-
streamerForKeys
public <T> Streamer<V,?> streamerForKeys(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)
-
streamerForKeyAndSubStoreAlts
public <T> Streamer<V,? extends Map.Entry<?,?>> streamerForKeyAndSubStoreAlts(T pattern, org.aksw.commons.tuple.TupleAccessorCore<? super T,? extends C> accessor)
Stream a single entry of the store alts themselves children can then pick an alternative based on their index- Returns:
-
getKeyComponentRaw
public C getKeyComponentRaw(Object key, int idx)
Description copied from interface:StorageNodeObtain components from the internal representation of key that was used for indexing w.r.t.StorageNode.getKeyTupleIdxs().idx- In the range 0 to {@link getKeyTupleIdxs().length} (exclusive) If a key has no components calling this method will always raiseIndexOutOfBoundsException- Returns:
-
-