Class NullIndexer
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.rete.network.BaseNode
-
- org.eclipse.viatra.query.runtime.rete.index.StandardIndexer
-
- org.eclipse.viatra.query.runtime.rete.index.SpecializedProjectionIndexer
-
- org.eclipse.viatra.query.runtime.rete.index.NullIndexer
-
- All Implemented Interfaces:
java.lang.Iterable<Tuple>
,Indexer
,IterableIndexer
,ProjectionIndexer
,NetworkStructureChangeSensitiveNode
,Node
- Direct Known Subclasses:
MemoryNullIndexer
public abstract class NullIndexer extends SpecializedProjectionIndexer
Defines an abstract trivial indexer that projects the contents of some stateful node to the empty tuple, and can therefore save space. Can only exist in connection with a stateful store, and must be operated by another node (the active node). Do not attach parents directly!- No Implement:
- Rely on the provided implementations
- No Reference:
- Use only via standard Node and Indexer interfaces
- No Instantiate:
- This class is not intended to be instantiated by clients.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.viatra.query.runtime.rete.index.SpecializedProjectionIndexer
SpecializedProjectionIndexer.ListenerSubscription
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Collection<Tuple>
emptySet
protected static Tuple
nullSignature
protected static java.util.Collection<Tuple>
nullSingleton
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.index.SpecializedProjectionIndexer
activeNode, subscriptions
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.index.StandardIndexer
mask, parent
-
Fields inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
-
Constructor Summary
Constructors Constructor Description NullIndexer(ReteContainer reteContainer, int tupleWidth, Supplier parent, Node activeNode, java.util.List<SpecializedProjectionIndexer.ListenerSubscription> sharedSubscriptionList)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Tuple>
get(Tuple signature)
int
getBucketCount()
java.util.Collection<Tuple>
getSignatures()
A view consisting of exactly those signatures whose tuple group is not emptyprotected abstract java.util.Collection<Tuple>
getTuples()
protected boolean
isEmpty()
protected boolean
isSingleElement()
java.util.Iterator<Tuple>
iterator()
void
propagateToListener(IndexerListener listener, Direction direction, Tuple updateElement, Timestamp timestamp)
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.index.SpecializedProjectionIndexer
attachListener, detachListener, getActiveNode, getSubscriptions, networkStructureChanged, propagate
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.index.StandardIndexer
assignTraceInfo, getContainer, getListeners, getMask, getParent, toStringCore
-
Methods inherited from class org.eclipse.viatra.query.runtime.rete.network.BaseNode
acceptPropagatedTraceInfo, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.rete.index.Indexer
getListeners, getMask, getParent, getTimeline
-
Methods inherited from interface org.eclipse.viatra.query.runtime.rete.network.Node
acceptPropagatedTraceInfo, assignTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
-
-
-
-
Constructor Detail
-
NullIndexer
public NullIndexer(ReteContainer reteContainer, int tupleWidth, Supplier parent, Node activeNode, java.util.List<SpecializedProjectionIndexer.ListenerSubscription> sharedSubscriptionList)
-
-
Method Detail
-
getTuples
protected abstract java.util.Collection<Tuple> getTuples()
-
get
public java.util.Collection<Tuple> get(Tuple signature)
- Returns:
- all stored tuples that conform to the specified signature, null if there are none such. CONTRACT: do not modify!
-
getSignatures
public java.util.Collection<Tuple> getSignatures()
Description copied from interface:IterableIndexer
A view consisting of exactly those signatures whose tuple group is not empty
-
isEmpty
protected boolean isEmpty()
-
isSingleElement
protected boolean isSingleElement()
-
iterator
public java.util.Iterator<Tuple> iterator()
-
getBucketCount
public int getBucketCount()
- Returns:
- the number of signatures whose tuple group is not empty
-
propagateToListener
public void propagateToListener(IndexerListener listener, Direction direction, Tuple updateElement, Timestamp timestamp)
- Specified by:
propagateToListener
in classSpecializedProjectionIndexer
-
-