Send feedback
Class QueryTreeContext<T> (2.0.0)
Stay organized with collections
Save and categorize content based on your preferences.
public abstract class QueryTreeContext<T>
The base class for specific query tree context used by the walker.
This class is used to maintain additional information gathered while
walking the tree. On this level it is used to collect return type
information.
Type Parameter Name Description T
Constructors
QueryTreeContext()
protected QueryTreeContext()
Methods
addChild()
Returns Type Description T
a child context for this context
addReturnType(QueryTreeContext.Type type)
public void addReturnType(QueryTreeContext.Type type)
children()
public Iterable<T> children()
Returns Type Description Iterable <T >
iterable over all children contexts
getChild(int index)
public T getChild(int index)
Parameter Name Description index
int
the index of the child to get
Returns Type Description T
the child context at the given index
getChildCount()
public int getChildCount()
Returns Type Description int
the number of children contexts
getCommonReturnTypes(T other)
public Set<QueryTreeContext.Type> getCommonReturnTypes(T other)
Parameter Name Description other
T
the other context whose types are to be inspected
Returns Type Description Set <Type >
a set of types common to this and the other context
getReturnTypes()
public Set<QueryTreeContext.Type> getReturnTypes()
Returns Type Description Set <Type >
the set of return types
getText()
Returns Type Description String
sets the text associated with this context
inDisjunction()
public boolean inDisjunction()
Returns Type Description boolean
true if this context's lowest ancester compounding operator (AND, OR) is a disjunction.
isCompatibleWith(QueryTreeContext.Type returnType)
public boolean isCompatibleWith(QueryTreeContext.Type returnType)
Parameter Name Description returnType
QueryTreeContext.Type
the type to be checked against types of this context
Returns Type Description boolean
whether or not it is compatible with at least one type
isField()
Returns Type Description boolean
returns if this context represents a field of a document
isFunction()
public boolean isFunction()
Returns Type Description boolean
if this context represents a function
isFuzzy()
Returns Type Description boolean
whether or not the value associated with this context is rewritable
isLiteral()
public boolean isLiteral()
Returns Type Description boolean
if this context represents a literal constant
isPhrase()
public boolean isPhrase()
Returns Type Description boolean
whether or not this context represents a phrase (quoted text)
isStrict()
public boolean isStrict()
Returns Type Description boolean
whether or not the value associated with this context must
not be rewritten
newChildContext()
protected abstract T newChildContext()
Returns Type Description T
a new child of type T
setInDisjunction(boolean inDisjunction)
public void setInDisjunction(boolean inDisjunction)
Parameter Name Description inDisjunction
boolean
setKind(QueryTreeContext.Kind kind)
public void setKind(QueryTreeContext.Kind kind)
setReturnType(QueryTreeContext.Type type)
public void setReturnType(QueryTreeContext.Type type)
setReturnTypes(Set<QueryTreeContext.Type> type)
public void setReturnTypes(Set<QueryTreeContext.Type> type)
Parameter Name Description type
Set <Type >
a set of types to be set as the only return types
setRewriteMode(QueryTreeContext.RewriteMode mode)
public void setRewriteMode(QueryTreeContext.RewriteMode mode)
setText(String text)
public void setText(String text)
Parameter Name Description text
String
returns the text associated with this context
toString()
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-04-26 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?