Class AbstractIndexTable
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.matchers.scopes.tables.AbstractIndexTable
-
- All Implemented Interfaces:
IIndexTable
- Direct Known Subclasses:
DefaultIndexTable,DisjointUnionTable,SimpleBinaryTable,SimpleUnaryTable
public abstract class AbstractIndexTable extends java.lang.Object implements IIndexTable
EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same.
- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractIndexTable.ColumnBoundListenersListeners interested in all tuples seeded by a single columnsprotected classAbstractIndexTable.GenericBoundListenersListeners interested in all tuples seeded by a tuple of valuesprotected static interfaceAbstractIndexTable.IListenersWithSameMaskRepresents all listeners subscribed to seeds with the given seed mask.protected classAbstractIndexTable.UniversalListenersListeners interested in all tuples
-
Field Summary
Fields Modifier and Type Field Description protected booleanemitNotificationsprotected TupleMaskemptyMaskprotected TupleemptyTupleprotected java.util.List<AbstractIndexTable.IListenersWithSameMask>listenerGroupsprotected ITableContexttableContext
-
Constructor Summary
Constructors Constructor Description AbstractIndexTable(IInputKey inputKey, ITableContext tableContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUpdateListener(Tuple seed, IQueryRuntimeContextListener listener)Subscribes for updates in the table, optionally seeded with the given tuple.protected voiddeliverChangeNotifications(Tuple updateTuple, boolean isInsertion)Implementors shall call this to deliver all notifications.IInputKeygetInputKey()protected AbstractIndexTable.IListenersWithSameMaskgetListenerGroup(TupleMask seedMask)protected voidlogError(java.lang.String message)voidremoveUpdateListener(Tuple seed, IQueryRuntimeContextListener listener)Unsubscribes from updates in the table, optionally seeded with the given tuple.java.lang.StringtoString()-
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.matchers.scopes.tables.IIndexTable
containsTuple, countTuples, enumerateTuples, enumerateValues, estimateProjectionSize, streamTuples, streamValues
-
-
-
-
Field Detail
-
tableContext
protected ITableContext tableContext
-
emptyMask
protected final TupleMask emptyMask
-
emptyTuple
protected final Tuple emptyTuple
-
emitNotifications
protected boolean emitNotifications
-
listenerGroups
protected java.util.List<AbstractIndexTable.IListenersWithSameMask> listenerGroups
-
-
Constructor Detail
-
AbstractIndexTable
public AbstractIndexTable(IInputKey inputKey, ITableContext tableContext)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getInputKey
public IInputKey getInputKey()
- Specified by:
getInputKeyin interfaceIIndexTable- Returns:
- the input key indexed by this table
-
logError
protected void logError(java.lang.String message)
-
deliverChangeNotifications
protected void deliverChangeNotifications(Tuple updateTuple, boolean isInsertion)
Implementors shall call this to deliver all notifications. Call may be conditioned toemitNotifications
-
addUpdateListener
public void addUpdateListener(Tuple seed, IQueryRuntimeContextListener listener)
Description copied from interface:IIndexTableSubscribes for updates in the table, optionally seeded with the given tuple.This should be called after initializing a result cache by an enumeration method.
- Specified by:
addUpdateListenerin interfaceIIndexTable- Parameters:
seed- can be null or a tuple with matching arity; if non-null, notifications will delivered only about those updates of the table that match the seed at positions where the seed is non-null.listener- will be notified of future changes
-
removeUpdateListener
public void removeUpdateListener(Tuple seed, IQueryRuntimeContextListener listener)
Description copied from interface:IIndexTableUnsubscribes from updates in the table, optionally seeded with the given tuple.- Specified by:
removeUpdateListenerin interfaceIIndexTable- Parameters:
seed- can be null or a tuple with matching arity; seeIIndexTable.addUpdateListener(Tuple, IQueryRuntimeContextListener)for definition.listener- will no longer be notified of future changes
-
getListenerGroup
protected AbstractIndexTable.IListenersWithSameMask getListenerGroup(TupleMask seedMask)
-
-