Class AbstractQueryMetaContext
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.matchers.context.AbstractQueryMetaContext
-
- All Implemented Interfaces:
IQueryMetaContext
- Direct Known Subclasses:
EMFQueryMetaContext
public abstract class AbstractQueryMetaContext extends java.lang.Object implements IQueryMetaContext
Common abstract class for implementers ofIQueryMetaContext- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor Description AbstractQueryMetaContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanLeadOutOfScope(IInputKey key)Tells whether the givenIInputKeyis an edge and may lead out of scope.java.util.Map<InputKeyImplication,java.util.Set<InputKeyImplication>>getConditionalImplications(IInputKey implyingKey)Returns known "double dispatch" implications, where the given implying key implies other input keys under certain additional conditions (themselves input keys).IPosetComparatorgetPosetComparator(java.lang.Iterable<IInputKey> key)Returns anIPosetComparatorfor the given set ofIInputKeys.java.util.Comparator<IInputKey>getSuggestedEliminationOrdering()For query normalizing, this is the order suggested for trying to eliminate input keys.java.util.Collection<InputKeyImplication>getWeakenedAlternatives(IInputKey implyingKey)Returns a set of implications (weakened alternatives), with a suggestion for the query planner that satisfying them first may help in satisfying the implying key.booleanisPosetKey(IInputKey key)Returns true if the givenIInputKeyrepresents a poset type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.context.IQueryMetaContext
getFunctionalDependencies, getImplications, isEnumerable, isStateless
-
-
-
-
Method Detail
-
getConditionalImplications
public java.util.Map<InputKeyImplication,java.util.Set<InputKeyImplication>> getConditionalImplications(IInputKey implyingKey)
Description copied from interface:IQueryMetaContextReturns known "double dispatch" implications, where the given implying key implies other input keys under certain additional conditions (themselves input keys). For example, a "type x, unscoped" input key may imply the "type x, in scope" input key under the condition of the input key "x is in scope"Note that for the obvious reasons, enumerable keys can only be implied by enumerable keys (either as the implying key or as the additional condition).
Note that symmetry is not required, i.e. the additional conditions do not have to list the same conditional implication.
- Specified by:
getConditionalImplicationsin interfaceIQueryMetaContext- Returns:
- multi-map, where the keys are additional conditions and the values are input key implications jointly implied by the condition and the given implying key.
- Since:
- 2.0
-
canLeadOutOfScope
public boolean canLeadOutOfScope(IInputKey key)
Description copied from interface:IQueryMetaContextTells whether the givenIInputKeyis an edge and may lead out of scope.- Specified by:
canLeadOutOfScopein interfaceIQueryMetaContext- Since:
- 1.6
-
getSuggestedEliminationOrdering
public java.util.Comparator<IInputKey> getSuggestedEliminationOrdering()
Description copied from interface:IQueryMetaContextFor query normalizing, this is the order suggested for trying to eliminate input keys.- Specified by:
getSuggestedEliminationOrderingin interfaceIQueryMetaContext- Since:
- 1.6
-
getWeakenedAlternatives
public java.util.Collection<InputKeyImplication> getWeakenedAlternatives(IInputKey implyingKey)
Description copied from interface:IQueryMetaContextReturns a set of implications (weakened alternatives), with a suggestion for the query planner that satisfying them first may help in satisfying the implying key.Note that for the obvious reasons, enumerable keys can only be implied by enumerable keys.
Must follow directly or transitively from implications of
IQueryMetaContext.getImplications(IInputKey).- Specified by:
getWeakenedAlternativesin interfaceIQueryMetaContext- Since:
- 1.6
-
isPosetKey
public boolean isPosetKey(IInputKey key)
Description copied from interface:IQueryMetaContextReturns true if the givenIInputKeyrepresents a poset type.- Specified by:
isPosetKeyin interfaceIQueryMetaContext
-
getPosetComparator
public IPosetComparator getPosetComparator(java.lang.Iterable<IInputKey> key)
Description copied from interface:IQueryMetaContextReturns anIPosetComparatorfor the given set ofIInputKeys.- Specified by:
getPosetComparatorin interfaceIQueryMetaContext- Parameters:
key- an iterable collection of input keys- Returns:
- the poset comparator
-
-