public class UserDefinedField extends FieldExpression
FieldExpression.StringMode
alias, EMPTY_ARRAY
Constructor and Description |
---|
UserDefinedField(String name) |
UserDefinedField(String name,
FieldExpression... args) |
Modifier and Type | Method and Description |
---|---|
UserDefinedField |
addArgument(FieldExpression value)
Add an argument.
|
UserDefinedField |
clone() |
boolean |
equalsIgnoreAlias(FieldExpression other)
Returns
true if other is the same as this , with the exception of alias. |
List<FieldExpression> |
getArguments()
Get the arguments.
|
String |
getName()
Get the name of the User Defined Function to evaluate.
|
Object |
getParameter(String key)
Get a parameter.
|
boolean |
getParameter(String key,
boolean defaultValue)
Get a
boolean parameter, returning defaultValue if parameter does not exist or is not a boolean. |
Date |
getParameter(String key,
Date defaultValue)
Get a
Date parameter, returning defaultValue if parameter is not a Date. |
double |
getParameter(String key,
double defaultValue)
Get a
double parameter, returning defaultValue if parameter does not exist or is not a double. |
int |
getParameter(String key,
int defaultValue)
Get an
int parameter, returning defaultValue if parameter does not exist or is not an int. |
long |
getParameter(String key,
long defaultValue)
Get a
long parameter, returning defaultValue if parameter does not exist or is not a long. |
String |
getParameter(String key,
String defaultValue)
Get a
String parameter, returning defaultValue if parameter does not exist. |
SchemaField.Type |
getType(Schema schema)
Resolve the type for this expression.
|
boolean |
hasChildren()
Returns
true if this field expression has any sub FieldExpressions. |
int |
hashCode() |
boolean |
isConstant()
Returns
true if this field expression evaluates to a constant value. |
UserDefinedField |
removeParameter(String key)
Remove a parameter.
|
void |
rewrite(QueryHandler handler,
boolean recursive)
Rewrite any query objects in this FieldExpression using
handler . |
FieldExpression |
rewriteChildren(FieldExpressionHandler handler)
Traverse this FieldExpression using
handler to visit/rewrite direct child elements if this expression. |
void |
setArguments(FieldExpression... value)
Set the arguments.
|
void |
setArguments(List<FieldExpression> value)
Set the arguments.
|
void |
setName(String value)
Set the name of the User Defined Function to evaluate.
|
UserDefinedField |
setParameter(String key,
Boolean value)
Set a parameter.
|
UserDefinedField |
setParameter(String key,
Date value)
Set a parameter.
|
UserDefinedField |
setParameter(String key,
Number value)
Set a parameter.
|
UserDefinedField |
setParameter(String key,
String value)
Set a parameter.
|
protected void |
toString(StringBuilder buffer,
FieldExpression.StringMode mode)
Writes the string representation of this field expression to
buffer . |
as, containsAlias, copyOf, equals, equalsIgnoreAlias, getAlias, getDefaultAlias, getFieldName, handleFieldExpression, isConstant, quote, rewrite, setAlias, toString, toString
public UserDefinedField(String name)
public UserDefinedField(String name, FieldExpression... args)
public String getName()
public void setName(String value)
public List<FieldExpression> getArguments()
public void setArguments(List<FieldExpression> value)
public void setArguments(FieldExpression... value)
public UserDefinedField addArgument(FieldExpression value)
public String getParameter(String key, String defaultValue)
String
parameter, returning defaultValue
if parameter does not exist.public Date getParameter(String key, Date defaultValue)
Date
parameter, returning defaultValue
if parameter is not a Date.public int getParameter(String key, int defaultValue)
int
parameter, returning defaultValue
if parameter does not exist or is not an int.public long getParameter(String key, long defaultValue)
long
parameter, returning defaultValue
if parameter does not exist or is not a long.public double getParameter(String key, double defaultValue)
double
parameter, returning defaultValue
if parameter does not exist or is not a double.public boolean getParameter(String key, boolean defaultValue)
boolean
parameter, returning defaultValue
if parameter does not exist or is not a boolean.public UserDefinedField setParameter(String key, String value)
public UserDefinedField setParameter(String key, Boolean value)
public UserDefinedField setParameter(String key, Date value)
public UserDefinedField setParameter(String key, Number value)
public UserDefinedField removeParameter(String key)
public boolean hasChildren()
true
if this field expression has any sub FieldExpressions.hasChildren
in class FieldExpression
public boolean isConstant()
true
if this field expression evaluates to a constant value.isConstant
in class FieldExpression
public SchemaField.Type getType(Schema schema)
getType
in class FieldExpression
public void rewrite(QueryHandler handler, boolean recursive)
handler
.rewrite
in class FieldExpression
public FieldExpression rewriteChildren(FieldExpressionHandler handler)
handler
to visit/rewrite direct child elements if this expression.
NOTE: this method traverses direct child expressions (if any) only.
rewriteChildren
in class FieldExpression
public boolean equalsIgnoreAlias(FieldExpression other)
true
if other
is the same as this
, with the exception of alias.equalsIgnoreAlias
in class FieldExpression
public int hashCode()
hashCode
in class FieldExpression
protected void toString(StringBuilder buffer, FieldExpression.StringMode mode)
buffer
.
NOTE: the alias will not be written to buffer by this function.
toString
in class FieldExpression
public UserDefinedField clone()
clone
in class FieldExpression
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.