Package com.attivio.sdk.search.fields
Class FieldExpression
- java.lang.Object
-
- com.attivio.sdk.search.fields.FieldExpression
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
BinaryFieldExpression,Condition,Constant,CurrentTime,DocBoost,FieldLength,Locate,MatchingFields,MatchingTerms,MultiaryFieldExpression,NumDocs,PartitionId,PhraseMatch,PhraseScore,QueryParameter,ScopeField,ScopeFrequency,ScopeVector,ScoreExplain,StoredField,Switch,TermVector,TotalScopeFrequency,TotalTermFrequency,UnaryFieldExpression,UserDefinedField
public abstract class FieldExpression extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableBase class for field expressions.A FieldExpression represents a column or field that is returned in a
SearchDocument.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classFieldExpression.StringModeMode for serializingFieldExpressionto a string.
-
Field Summary
Fields Modifier and Type Field Description protected static FieldExpression[]EMPTY_ARRAYEmpty array of field expressions.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFieldExpression()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static FieldExpressionapply(java.util.function.Function<FieldExpression,FieldExpression> handler, FieldExpression input)FieldExpressionclone()static FieldExpression[]copyOf(FieldExpression[] args, int length)Create a copy ofargs.FieldExpressionforEachField(java.util.function.Function<FieldExpression,FieldExpression> handler)Applieshandlerfor eachFieldExpressionargument.FieldExpressionforEachPhrase(PhraseHandler handler)Applieshandlerfor eachPhraseargument.FieldExpressionforEachQuery(QueryHandler handler)Applieshandlerfor eachQueryargument.java.lang.StringgetDefaultName()Get the default name to use for this FieldExpression.java.lang.StringgetFieldName()Get the field name for this expression.abstract SchemaField.TypegetType(Schema schema)Resolve the type for this expression.abstract booleanhasChildren()Returnstrueif this field expression has any sub FieldExpressions.inthashCode()abstract booleanisConstant()Returnstrueif this field expression evaluates to a constant value.protected static booleanisConstant(FieldExpression value)protected static FieldExpressionparse(StringParser parser)protected static voidquote(java.lang.StringBuilder buffer, java.lang.String text)Addtexttobufferas quoted string.voidrewrite(QueryHandler handler, boolean recursive)Rewrite any query objects in this FieldExpression usinghandler.protected static voidrewrite(QueryHandler handler, boolean recursive, FieldExpression input)FieldExpressionrewriteChildren(FieldExpressionHandler handler)Deprecated.useforEachField(Function)instead.java.lang.StringtoString()Return String representation of expression.voidtoString(java.lang.StringBuilder buffer)Writes the string representation of this field expression tobuffer.protected abstract voidtoString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.static FieldExpressionvalueOf(java.lang.String value)
-
-
-
Field Detail
-
EMPTY_ARRAY
protected static final FieldExpression[] EMPTY_ARRAY
Empty array of field expressions.
-
-
Method Detail
-
getType
public abstract SchemaField.Type getType(Schema schema)
Resolve the type for this expression.
-
isConstant
public abstract boolean isConstant()
Returnstrueif this field expression evaluates to a constant value.
-
getDefaultName
public final java.lang.String getDefaultName()
Get the default name to use for this FieldExpression.
-
getFieldName
public java.lang.String getFieldName()
Get the field name for this expression.This is used as a hint to the search engine to tie back to the schema. null may be returned if this expression contains no field. If this expression is composed of many fields, this can be either the "primary" field for the expression, or null.
-
hasChildren
public abstract boolean hasChildren()
Returnstrueif this field expression has any sub FieldExpressions.
-
rewriteChildren
@Deprecated public final FieldExpression rewriteChildren(FieldExpressionHandler handler)
Deprecated.useforEachField(Function)instead.Traverse this FieldExpression usinghandlerto visit/rewrite direct child elements if this expression.NOTE: this method traverses direct child expressions (if any) only.
-
rewrite
public void rewrite(QueryHandler handler, boolean recursive)
Rewrite any query objects in this FieldExpression usinghandler.
-
forEachField
public FieldExpression forEachField(java.util.function.Function<FieldExpression,FieldExpression> handler)
-
forEachQuery
public FieldExpression forEachQuery(QueryHandler handler)
-
forEachPhrase
public FieldExpression forEachPhrase(PhraseHandler handler)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public final java.lang.String toString()
Return String representation of expression.- Overrides:
toStringin classjava.lang.Object
-
toString
public final void toString(java.lang.StringBuilder buffer)
Writes the string representation of this field expression tobuffer.
-
toString
protected abstract void toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.
-
quote
protected static void quote(java.lang.StringBuilder buffer, java.lang.String text)Addtexttobufferas quoted string.NOTE: value will only be quoted if it contains non-alphanumeric characters.
-
clone
public FieldExpression clone()
- Overrides:
clonein classjava.lang.Object
-
isConstant
protected static boolean isConstant(FieldExpression value)
-
apply
protected static FieldExpression apply(java.util.function.Function<FieldExpression,FieldExpression> handler, FieldExpression input)
-
rewrite
protected static void rewrite(QueryHandler handler, boolean recursive, FieldExpression input)
-
copyOf
public static final FieldExpression[] copyOf(FieldExpression[] args, int length)
Create a copy ofargs.
-
parse
protected static FieldExpression parse(StringParser parser)
-
valueOf
public static FieldExpression valueOf(java.lang.String value)
-
-