public class DisjointUnionTable extends AbstractIndexTable
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.
AbstractIndexTable.ColumnBoundListeners, AbstractIndexTable.GenericBoundListeners, AbstractIndexTable.IListenersWithSameMask, AbstractIndexTable.UniversalListeners
Modifier and Type | Field and Description |
---|---|
protected java.util.List<IIndexTable> |
childTables |
emitNotifications, emptyMask, emptyTuple, listenerGroups, tableContext
Constructor and Description |
---|
DisjointUnionTable(IInputKey inputKey,
ITableContext tableContext) |
Modifier and Type | Method and Description |
---|---|
void |
addChildTable(IIndexTable child)
Precondition: the new child currently is, and will forever stay, disjoint from any other child tables.
|
void |
addUpdateListener(Tuple seed,
IQueryRuntimeContextListener listener)
Subscribes for updates in the table, optionally seeded with the given tuple.
|
boolean |
containsTuple(ITuple seed)
Simpler form of
IIndexTable.enumerateTuples(TupleMask, ITuple) in the case where all values of the tuples are bound
by the seed. |
int |
countTuples(TupleMask seedMask,
ITuple seed)
Returns the number of tuples, optionally seeded with the given tuple.
|
java.util.Optional<java.lang.Long> |
estimateProjectionSize(TupleMask groupMask,
Accuracy requiredAccuracy)
Gives an estimate of the number of different groups the tuples of the table are projected into by the given mask
(e.g.
|
java.util.List<IIndexTable> |
getChildTables() |
void |
removeUpdateListener(Tuple seed,
IQueryRuntimeContextListener listener)
Unsubscribes from updates in the table, optionally seeded with the given tuple.
|
java.util.stream.Stream<? extends Tuple> |
streamTuples(TupleMask seedMask,
ITuple seed)
Returns the tuples, optionally seeded with the given tuple.
|
java.util.stream.Stream<? extends java.lang.Object> |
streamValues(TupleMask seedMask,
ITuple seed)
Simpler form of
IIndexTable.enumerateTuples(TupleMask, ITuple) in the case where all values of the tuples are bound
by the seed except for one. |
deliverChangeNotifications, getInputKey, getListenerGroup, logError, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
enumerateTuples, enumerateValues
protected java.util.List<IIndexTable> childTables
public DisjointUnionTable(IInputKey inputKey, ITableContext tableContext)
public java.util.List<IIndexTable> getChildTables()
public void addChildTable(IIndexTable child)
public int countTuples(TupleMask seedMask, ITuple seed)
IIndexTable
Selects the tuples in the table, optionally seeded with the given tuple, and then returns their number.
seedMask
- a mask that extracts those parameters of the input key (from the entire parameter list) that should be
bound to a fixed value; must not be null. Note: any given index must occur at most
once in seedMask.seed
- the tuple of fixed values restricting the row set to be considered, in the same order as given in
parameterSeedMask, so that for each considered row tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(row)) should hold. Must not be null.public java.util.Optional<java.lang.Long> estimateProjectionSize(TupleMask groupMask, Accuracy requiredAccuracy)
IIndexTable
Derived tables may return Optional.empty()
if it would be costly to provide an answer up to the required precision.
Direct storage tables are expected to always be able to give an exact count.
PRE: TupleMask.isNonrepeating()
must hold for the group mask.
public java.util.stream.Stream<? extends Tuple> streamTuples(TupleMask seedMask, ITuple seed)
IIndexTable
seedMask
- a mask that extracts those parameters of the input key (from the entire parameter list) that should be
bound to a fixed value; must not be null. Note: any given index must occur at most
once in seedMask.seed
- the tuple of fixed values restricting the row set to be considered, in the same order as given in
parameterSeedMask, so that for each considered row tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(row)) should hold. Must not be null.public java.util.stream.Stream<? extends java.lang.Object> streamValues(TupleMask seedMask, ITuple seed)
IIndexTable
IIndexTable.enumerateTuples(TupleMask, ITuple)
in the case where all values of the tuples are bound
by the seed except for one.
Selects the tuples in the table, optionally seeded with the given tuple, and then returns the single value from each tuple which is not bound by the seed mask.
seedMask
- a mask that extracts those parameters of the input key (from the entire parameter list) that should be
bound to a fixed value; must not be null. Note: any given index must occur at most
once in seedMask, and seedMask must include all parameters in any arbitrary order except one.seed
- the tuple of fixed values restricting the row set to be considered, in the same order as given in
parameterSeedMask, so that for each considered row tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(row)) should hold. Must not be null.public boolean containsTuple(ITuple seed)
IIndexTable
IIndexTable.enumerateTuples(TupleMask, ITuple)
in the case where all values of the tuples are bound
by the seed.
Returns whether the given tuple is in the table identified by the input key.
seed
- a row tuple of fixed values whose presence in the table is queriedpublic void addUpdateListener(Tuple seed, IQueryRuntimeContextListener listener)
IIndexTable
This should be called after initializing a result cache by an enumeration method.
addUpdateListener
in interface IIndexTable
addUpdateListener
in class AbstractIndexTable
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 changespublic void removeUpdateListener(Tuple seed, IQueryRuntimeContextListener listener)
IIndexTable
removeUpdateListener
in interface IIndexTable
removeUpdateListener
in class AbstractIndexTable
seed
- can be null or a tuple with matching arity;
see IIndexTable.addUpdateListener(Tuple, IQueryRuntimeContextListener)
for definition.listener
- will no longer be notified of future changes