public abstract class AbstractQueryRuntimeContext extends java.lang.Object implements IQueryRuntimeContext
Constructor and Description |
---|
AbstractQueryRuntimeContext() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsTuple(IInputKey key,
TupleMask seedMask,
ITuple seed)
Simpler form of
#enumerateTuples(IInputKey, TupleMask, Tuple) in the case where all values of the tuples
are bound by the seed. |
int |
countTuples(IInputKey key,
TupleMask seedMask,
ITuple seed)
Returns the number of tuples in the extensional relation identified by the input key seeded with the given mask and tuple.
|
void |
ensureIndexed(IInputKey key,
IndexingService service)
If the given (enumerable) input key is not yet indexed, the model will be traversed
(after the end of the outermost coalescing block, see
IQueryRuntimeContext.coalesceTraversals(Callable) )
so that the index can be built. |
java.lang.Iterable<Tuple> |
enumerateTuples(IInputKey key,
TupleMask seedMask,
ITuple seed)
Returns the tuples in the extensional relation identified by the input key, optionally seeded with the given tuple.
|
java.lang.Iterable<? extends java.lang.Object> |
enumerateValues(IInputKey key,
TupleMask seedMask,
ITuple seed)
Simpler form of
#enumerateTuples(IInputKey, TupleMask, Tuple) in the case where all values of the tuples
are bound by the seed except for one. |
boolean |
isIndexed(IInputKey key,
IndexingService service)
Returns true if index is available for the given key providing the given service.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addUpdateListener, coalesceTraversals, containsTuple, countTuples, ensureIndexed, ensureWildcardIndexing, enumerateTuples, enumerateValues, executeAfterTraversal, getMetaContext, isCoalescing, isIndexed, removeUpdateListener, unwrapElement, unwrapTuple, wrapElement, wrapTuple
public void ensureIndexed(IInputKey key, IndexingService service)
IQueryRuntimeContext
IQueryRuntimeContext.coalesceTraversals(Callable)
)
so that the index can be built. It is possible that the base indexer will select a higher indexing level merging
multiple indexing requests to an appropriate level.
Postcondition: After invoking this method, #getIndexed(IInputKey, IndexingService)
for the same key
and service will be guaranteed to return the requested or a highing indexing level as soon as IQueryRuntimeContext.isCoalescing()
first returns false.
Precondition: the given key is enumerable, see IQueryMetaContext.isEnumerable(IInputKey)
.
ensureIndexed
in interface IQueryRuntimeContext
public boolean isIndexed(IInputKey key, IndexingService service)
IQueryRuntimeContext
isIndexed
in interface IQueryRuntimeContext
public int countTuples(IInputKey key, TupleMask seedMask, ITuple seed)
IQueryRuntimeContext
countTuples
in interface IQueryRuntimeContext
key
- an input keyseedMask
- 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 match set to be considered, in the same order as given in
parameterSeedMask, so that for each considered match tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(match)) should hold. Must not be null.Precondition: the given key is enumerable, see IQueryMetaContext.isEnumerable(IInputKey)
.
public java.lang.Iterable<Tuple> enumerateTuples(IInputKey key, TupleMask seedMask, ITuple seed)
IQueryRuntimeContext
enumerateTuples
in interface IQueryRuntimeContext
key
- an input keyseedMask
- 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 match set to be considered, in the same order as given in
parameterSeedMask, so that for each considered match tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(match)) should hold. Must not be null.Precondition: the given key is enumerable, see IQueryMetaContext.isEnumerable(IInputKey)
.
public java.lang.Iterable<? extends java.lang.Object> enumerateValues(IInputKey key, TupleMask seedMask, ITuple seed)
IQueryRuntimeContext
#enumerateTuples(IInputKey, TupleMask, Tuple)
in the case where all values of the tuples
are bound by the seed except for one.
Selects the tuples in the extensional relation identified by the input key, optionally seeded with the given tuple, and then returns the single value from each tuple which is not bound by the ssed mask.
enumerateValues
in interface IQueryRuntimeContext
key
- an input keyseedMask
- 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 match set to be considered, in the same order as given in
parameterSeedMask, so that for each considered match tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(match)) should hold. Must not be null.
Precondition: the given key is enumerable, see IQueryMetaContext.isEnumerable(IInputKey)
.
public boolean containsTuple(IInputKey key, TupleMask seedMask, ITuple seed)
IQueryRuntimeContext
#enumerateTuples(IInputKey, TupleMask, Tuple)
in the case where all values of the tuples
are bound by the seed.
Returns whether the given tuple is in the extensional relation identified by the input key.
Note: this call works for non-enumerable input keys as well.
containsTuple
in interface IQueryRuntimeContext
key
- an input keyseedMask
- 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: this mask is expected to be
TupleMask.identity(type.getArity()); the parameter is entirely ignored. The parameter is only
introduced to avoid potential confusion between the deprecated
IQueryRuntimeContext.containsTuple(IInputKey, Tuple)
method and this. For version 2.0 this conflict will be
resolved by having only a single containsTuple(IInputKey, ITuple) method.seed
- the tuple of fixed values restricting the match set to be considered, in the same order as given in
parameterSeedMask, so that for each considered match tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(match)) should hold. Must not be null.