Class StorageNodeLeafDomainList<D,C,V>

java.lang.Object
org.aksw.commons.index.core.StorageNodeBase<D,C,List<V>>
org.aksw.commons.index.core.StorageNodeLeafDomainList<D,C,V>
Type Parameters:
D -
C -
V -
All Implemented Interfaces:
StorageNode<D,C,List<V>>, StorageNodeMutable<D,C,List<V>>

public class StorageNodeLeafDomainList<D,C,V> extends StorageNodeBase<D,C,List<V>>
Essentially a view of a Set as a Mapinvalid input: '<'Void, Set>
Author:
Claus Stadler 11/09/2020
  • Field Details

  • Constructor Details

  • Method Details

    • holdsDomainTuples

      public boolean holdsDomainTuples()
      Description copied from interface: StorageNode
      Flag that when true indicates that this storage node's values are tuples of type D - i.e. "domain tuples".
      Returns:
    • tupleToValue

      public V tupleToValue(D tupleLike)
    • getChildren

      public List<StorageNode<D,C,?>> getChildren()
      Description copied from interface: StorageNode
      Each node in the storage expression may have 0 or more children
      Returns:
    • add

      public boolean add(List<V> list, D tupleLike)
    • remove

      public boolean remove(List<V> set, D tupleLike)
    • clear

      public void clear(List<V> store)
      Description copied from interface: StorageNodeMutable
      Clear a store's content. Cascades to any sub-stores.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • streamerForKeysAsComponent

      public <T> Streamer<List<V>,C> streamerForKeysAsComponent(T pattern, TupleAccessor<? super T, ? extends C> accessor)
      Description copied from interface: StorageNode
      Compiles 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<List<V>,List<C>> streamerForKeysAsTuples(T pattern, TupleAccessor<? super T, ? extends C> accessor)
      Description copied from interface: StorageNode
      Compiles 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<List<V>,V> streamerForValues(T pattern, TupleAccessor<? super T, ? extends C> accessor)
      Description copied from interface: StorageNode
      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
      Type Parameters:
      T -
      Parameters:
      pattern -
      accessor -
      Returns:
    • streamerForKeyAndSubStoreAlts

      public <T> Streamer<List<V>, ? extends Map.Entry<?,?>> streamerForKeyAndSubStoreAlts(T pattern, TupleAccessor<? super T, ? extends C> accessor)
      Description copied from interface: StorageNode
      The streamer returns entry that hold a tuple-like key and conceptually alternatives of sub-stores The tuple components of the key can be accessed using StorageNode.getKeyComponentRaw(Object, int) There are as many components as the length of StorageNode.getKeyTupleIdxs() If there is 0 components then any invocation of StorageNode.getKeyComponentRaw(Object, int) will fail with a UnsupportedOperationException. To extract a specific alternative from the substore use StorageNode.chooseSubStore(Object, int). If StorageNode.getChildren() is not empty then there are as many substore indices as there are children If there are no children then there is an implicit single sub store with index 0
      Type Parameters:
      T -
      Parameters:
      pattern -
      accessor -
      Returns:
    • streamEntries

      public <T> Stream<V> streamEntries(List<V> list, T tupleLike, TupleAccessor<? super T, ? extends C> tupleAccessor)
      Description copied from interface: StorageNode
      Stream all entries under equality constraints obtained from a tuple-like pattern
      Type Parameters:
      T -
      Parameters:
      list -
      tupleLike -
      tupleAccessor -
      Returns:
    • streamerForKeys

      public <T> Streamer<List<V>,?> streamerForKeys(T pattern, TupleAccessor<? super T, ? extends C> accessor)
    • getKeyComponentRaw

      public C getKeyComponentRaw(Object key, int idx)
      Description copied from interface: StorageNode
      Obtain components from the internal representation of key that was used for indexing w.r.t. StorageNode.getKeyTupleIdxs().
      Parameters:
      key -
      idx - In the range 0 to
      invalid @link
      {@link getKeyTupleIdxs().length
      } (exclusive) If a key has no components calling this method will always raise IndexOutOfBoundsException
      Returns:
    • chooseSubStore

      public Object chooseSubStore(List<V> store, int subStoreIdx)
    • newStore

      public List<V> newStore()
      Specified by:
      newStore in interface StorageNodeMutable<D,C,V>
    • isListNode

      public boolean isListNode()
      Description copied from interface: StorageNode
      Whether this storage node stores are lists Experimental method; may be replaced by a generic getStoreType() method that returns e.g Alt.class, Set.class, etc.
      Specified by:
      isListNode in interface StorageNode<D,C,V>
      Returns:
    • getStoreAsList

      public List<?> getStoreAsList(Object store)
      Specified by:
      getStoreAsList in interface StorageNode<D,C,V>
    • isEmpty

      public boolean isEmpty(List<V> store)
      Specified by:
      isEmpty in interface StorageNodeMutable<D,C,V>