T
- the actual class used by specific tree visitorspublic abstract class QueryTreeContext<T extends QueryTreeContext<T>>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
QueryTreeContext.Kind
Enumeration of the kind of the term that has a given return
type.
|
static class |
QueryTreeContext.RewriteMode
Enumeration of text terms rewrite mode.
|
static class |
QueryTreeContext.Type
Enumeration of supported return types.
|
Modifier and Type | Method and Description |
---|---|
T |
addChild() |
void |
addReturnType(QueryTreeContext.Type type) |
java.lang.Iterable<T> |
children() |
T |
getChild(int index) |
int |
getChildCount() |
java.util.Set<QueryTreeContext.Type> |
getCommonReturnTypes(T other) |
java.util.Set<QueryTreeContext.Type> |
getReturnTypes() |
java.lang.String |
getText() |
boolean |
isCompatibleWith(QueryTreeContext.Type returnType) |
boolean |
isField() |
boolean |
isFunction() |
boolean |
isFuzzy() |
boolean |
isLiteral() |
boolean |
isPhrase() |
boolean |
isStrict() |
void |
setKind(QueryTreeContext.Kind kind) |
void |
setReturnType(QueryTreeContext.Type type) |
void |
setReturnTypes(java.util.Set<QueryTreeContext.Type> type) |
void |
setRewriteMode(QueryTreeContext.RewriteMode mode) |
void |
setText(java.lang.String text) |
java.lang.String |
toString() |
public T addChild()
public java.lang.Iterable<T> children()
public int getChildCount()
public T getChild(int index)
index
- the index of the child to getpublic void addReturnType(QueryTreeContext.Type type)
type
- additional type to be added to current return typespublic void setReturnType(QueryTreeContext.Type type)
type
- the unique return type for this contextpublic void setReturnTypes(java.util.Set<QueryTreeContext.Type> type)
type
- a set of types to be set as the only return typespublic java.util.Set<QueryTreeContext.Type> getReturnTypes()
public java.util.Set<QueryTreeContext.Type> getCommonReturnTypes(T other)
other
- the other context whose types are to be inspectedpublic boolean isCompatibleWith(QueryTreeContext.Type returnType)
returnType
- the type to be checked against types of this contextpublic void setRewriteMode(QueryTreeContext.RewriteMode mode)
mode
- the rewrite mode for the value represented by this contextpublic boolean isFuzzy()
public boolean isStrict()
public void setKind(QueryTreeContext.Kind kind)
kind
- the kind of thepublic boolean isPhrase()
public boolean isFunction()
public boolean isLiteral()
public boolean isField()
public java.lang.String getText()
public void setText(java.lang.String text)
text
- returns the text associated with this contextpublic java.lang.String toString()
toString
in class java.lang.Object