public abstract class AbstractCompositeIQTree<N extends QueryNode> extends Object implements CompositeIQTree<N>
| Modifier and Type | Field and Description |
|---|---|
protected IntermediateQueryFactory |
iqFactory |
protected IQTreeTools |
iqTreeTools |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCompositeIQTree(N rootNode,
com.google.common.collect.ImmutableList<IQTree> children,
IQProperties iqProperties,
IQTreeTools iqTreeTools,
IntermediateQueryFactory iqFactory,
TermFactory termFactory) |
protected |
AbstractCompositeIQTree(N rootNode,
com.google.common.collect.ImmutableList<IQTree> children,
IQTreeCache treeCache,
IQTreeTools iqTreeTools,
IntermediateQueryFactory iqFactory,
TermFactory termFactory) |
| Modifier and Type | Method and Description |
|---|---|
IQTree |
applyDescendingSubstitution(ImmutableSubstitution<? extends VariableOrGroundTerm> descendingSubstitution,
Optional<ImmutableExpression> constraint)
Applies the descending substitution and performs SOME optimizations.
|
IQTree |
applyFreshRenaming(InjectiveVar2VarSubstitution freshRenamingSubstitution)
Particular type of descending substitution: only renaming some variables by external ones.
|
protected abstract IQTree |
applyFreshRenaming(InjectiveVar2VarSubstitution freshRenamingSubstitution,
boolean alreadyNormalized) |
protected abstract IQTree |
applyRegularDescendingSubstitution(ImmutableSubstitution<? extends VariableOrGroundTerm> descendingSubstitution,
Optional<ImmutableExpression> constraint) |
protected abstract boolean |
computeIsDistinct() |
protected abstract com.google.common.collect.ImmutableSet<ImmutableSubstitution<NonVariableTerm>> |
computePossibleVariableDefinitions() |
protected abstract com.google.common.collect.ImmutableSet<com.google.common.collect.ImmutableSet<Variable>> |
computeUniqueConstraints() |
protected abstract VariableNullability |
computeVariableNullability() |
protected com.google.common.collect.ImmutableSet<Variable> |
computeVariables() |
boolean |
equals(Object o) |
com.google.common.collect.ImmutableList<IQTree> |
getChildren() |
com.google.common.collect.ImmutableSet<Variable> |
getKnownVariables()
Variables present in the tree
|
com.google.common.collect.ImmutableSet<ImmutableSubstitution<NonVariableTerm>> |
getPossibleVariableDefinitions()
Returns a set of substitutions that define the projected variables when they are constructed.
|
protected IQProperties |
getProperties() |
N |
getRootNode() |
protected IQTreeCache |
getTreeCache() |
VariableNullability |
getVariableNullability() |
com.google.common.collect.ImmutableSet<Variable> |
getVariables()
Variables projected by the tree
|
int |
hashCode() |
com.google.common.collect.ImmutableSet<com.google.common.collect.ImmutableSet<Variable>> |
inferUniqueConstraints()
NOT guaranteed to return all the unique constraints (MAY BE INCOMPLETE)
Set of sets of determinants
|
boolean |
isDistinct()
Returns true if it guarantees that all its results will be distinct
|
boolean |
isEquivalentTo(IQTree tree) |
protected Optional<ImmutableSubstitution<? extends VariableOrGroundTerm>> |
normalizeDescendingSubstitution(ImmutableSubstitution<? extends VariableOrGroundTerm> descendingSubstitution) |
String |
toString() |
void |
validate() |
protected abstract void |
validateNode()
Only validates the node, not its children
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitacceptTransformer, acceptVisitor, applyDescendingSubstitutionWithoutOptimizing, isConstructed, isDeclaredAsEmpty, isLeaf, liftIncompatibleDefinitions, normalizeForOptimization, propagateDownConstraint, removeDistincts, replaceSubTreeprotected final IQTreeTools iqTreeTools
protected final IntermediateQueryFactory iqFactory
protected AbstractCompositeIQTree(N rootNode, com.google.common.collect.ImmutableList<IQTree> children, IQProperties iqProperties, IQTreeTools iqTreeTools, IntermediateQueryFactory iqFactory, TermFactory termFactory)
protected AbstractCompositeIQTree(N rootNode, com.google.common.collect.ImmutableList<IQTree> children, IQTreeCache treeCache, IQTreeTools iqTreeTools, IntermediateQueryFactory iqFactory, TermFactory termFactory)
public N getRootNode()
getRootNode in interface CompositeIQTree<N extends QueryNode>getRootNode in interface IQTreepublic com.google.common.collect.ImmutableList<IQTree> getChildren()
getChildren in interface IQTreepublic com.google.common.collect.ImmutableSet<Variable> getVariables()
IQTreegetVariables in interface IQTreeprotected com.google.common.collect.ImmutableSet<Variable> computeVariables()
public com.google.common.collect.ImmutableSet<Variable> getKnownVariables()
IQTreegetKnownVariables in interface IQTreepublic boolean isEquivalentTo(IQTree tree)
isEquivalentTo in interface IQTreeprotected IQProperties getProperties()
protected Optional<ImmutableSubstitution<? extends VariableOrGroundTerm>> normalizeDescendingSubstitution(ImmutableSubstitution<? extends VariableOrGroundTerm> descendingSubstitution) throws IQTreeTools.UnsatisfiableDescendingSubstitutionException
public IQTree applyDescendingSubstitution(ImmutableSubstitution<? extends VariableOrGroundTerm> descendingSubstitution, Optional<ImmutableExpression> constraint)
IQTreeapplyDescendingSubstitution in interface IQTreepublic IQTree applyFreshRenaming(InjectiveVar2VarSubstitution freshRenamingSubstitution)
IQTreeapplyFreshRenaming in interface IQTreeprotected abstract IQTree applyFreshRenaming(InjectiveVar2VarSubstitution freshRenamingSubstitution, boolean alreadyNormalized)
protected abstract IQTree applyRegularDescendingSubstitution(ImmutableSubstitution<? extends VariableOrGroundTerm> descendingSubstitution, Optional<ImmutableExpression> constraint)
public final void validate()
throws InvalidIntermediateQueryException
validate in interface IQTreeInvalidIntermediateQueryExceptionprotected abstract void validateNode()
throws InvalidIntermediateQueryException
public VariableNullability getVariableNullability()
getVariableNullability in interface IQTreeprotected abstract VariableNullability computeVariableNullability()
protected IQTreeCache getTreeCache()
public com.google.common.collect.ImmutableSet<ImmutableSubstitution<NonVariableTerm>> getPossibleVariableDefinitions()
IQTreegetPossibleVariableDefinitions in interface IQTreeprotected abstract com.google.common.collect.ImmutableSet<ImmutableSubstitution<NonVariableTerm>> computePossibleVariableDefinitions()
public com.google.common.collect.ImmutableSet<com.google.common.collect.ImmutableSet<Variable>> inferUniqueConstraints()
IQTreeinferUniqueConstraints in interface IQTreeprotected abstract com.google.common.collect.ImmutableSet<com.google.common.collect.ImmutableSet<Variable>> computeUniqueConstraints()
public boolean isDistinct()
IQTreeisDistinct in interface IQTreeprotected abstract boolean computeIsDistinct()
Copyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.