Class QueryTreeContext<T extends QueryTreeContext<T>>
java.lang.Object
com.google.appengine.api.search.query.QueryTreeContext<T>
- Type Parameters:
T
- the actual class used by specific tree visitors
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of the kind of the term that has a given return type.static enum
Enumeration of text terms rewrite mode.static enum
Enumeration of supported return types. -
Method Summary
Modifier and TypeMethodDescriptionaddChild()
void
children()
getChild
(int index) int
getCommonReturnTypes
(T other) getText()
boolean
boolean
isCompatibleWith
(QueryTreeContext.Type returnType) boolean
isField()
boolean
boolean
isFuzzy()
boolean
boolean
isPhrase()
boolean
isStrict()
void
setInDisjunction
(boolean inDisjunction) void
setKind
(QueryTreeContext.Kind kind) void
void
void
void
toString()
-
Method Details
-
addChild
- Returns:
- a child context for this context
-
children
- Returns:
- iterable over all children contexts
-
getChildCount
public int getChildCount()- Returns:
- the number of children contexts
-
getChild
- Parameters:
index
- the index of the child to get- Returns:
- the child context at the given index
-
addReturnType
- Parameters:
type
- additional type to be added to current return types
-
setReturnType
- Parameters:
type
- the unique return type for this context
-
setReturnTypes
- Parameters:
type
- a set of types to be set as the only return types
-
setInDisjunction
public void setInDisjunction(boolean inDisjunction) -
getReturnTypes
- Returns:
- the set of return types
-
getCommonReturnTypes
- Parameters:
other
- the other context whose types are to be inspected- Returns:
- a set of types common to this and the other context
-
isCompatibleWith
- Parameters:
returnType
- the type to be checked against types of this context- Returns:
- whether or not it is compatible with at least one type
-
setRewriteMode
- Parameters:
mode
- the rewrite mode for the value represented by this context
-
isFuzzy
public boolean isFuzzy()- Returns:
- whether or not the value associated with this context is rewritable
-
isStrict
public boolean isStrict()- Returns:
- whether or not the value associated with this context must not be rewritten
-
setKind
- Parameters:
kind
- the kind of the
-
isPhrase
public boolean isPhrase()- Returns:
- whether or not this context represents a phrase (quoted text)
-
isFunction
public boolean isFunction()- Returns:
- if this context represents a function
-
isLiteral
public boolean isLiteral()- Returns:
- if this context represents a literal constant
-
isField
public boolean isField()- Returns:
- returns if this context represents a field of a document
-
inDisjunction
public boolean inDisjunction()- Returns:
- true if this context's lowest ancester compounding operator (AND, OR) is a disjunction.
-
getText
- Returns:
- sets the text associated with this context
-
setText
- Parameters:
text
- returns the text associated with this context
-
toString
-