Class QueryTreeContext<T> (2.0.0)

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.

Inheritance

java.lang.Object > QueryTreeContext<T>

Type Parameter

Name Description
T

Constructors

QueryTreeContext()

protected QueryTreeContext()

Methods

addChild()

public T addChild()
Returns
Type Description
T

a child context for this context

addReturnType(QueryTreeContext.Type type)

public void addReturnType(QueryTreeContext.Type type)
Parameter
Name Description
type QueryTreeContext.Type

additional type to be added to current return types

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()

public String 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()

public boolean 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()

public boolean 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)
Parameter
Name Description
kind QueryTreeContext.Kind

the kind of the

setReturnType(QueryTreeContext.Type type)

public void setReturnType(QueryTreeContext.Type type)
Parameter
Name Description
type QueryTreeContext.Type

the unique return type for this context

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)
Parameter
Name Description
mode QueryTreeContext.RewriteMode

the rewrite mode for the value represented by this context

setText(String text)

public void setText(String text)
Parameter
Name Description
text String

returns the text associated with this context

toString()

public String toString()
Returns
Type Description
String
Overrides