|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectExpressionAbstract
DefaultExpression
FunctionExpressionImpl
public abstract class FunctionExpressionImpl
Abstract class for a function expression implementation
Field Summary | |
---|---|
protected Literal |
fallback
|
protected FunctionName |
functionName
FunctionName provided by subclass; or lazely created |
protected String |
name
function name |
protected List<Expression> |
params
function params |
Fields inherited from class DefaultExpression |
---|
expressionType, permissiveConstruction |
Fields inherited from interface ExpressionType |
---|
ATTRIBUTE, ATTRIBUTE_DOUBLE, ATTRIBUTE_GEOMETRY, ATTRIBUTE_INTEGER, ATTRIBUTE_STRING, ATTRIBUTE_UNDECLARED, FUNCTION, LITERAL_DOUBLE, LITERAL_GEOMETRY, LITERAL_INTEGER, LITERAL_LONG, LITERAL_STRING, LITERAL_UNDECLARED, MATH_ADD, MATH_DIVIDE, MATH_MULTIPLY, MATH_SUBTRACT |
Fields inherited from interface Expression |
---|
NIL |
Constructor Summary | |
---|---|
protected |
FunctionExpressionImpl(FunctionName functionName)
Preferred constructor to ensure name and functionName match. |
protected |
FunctionExpressionImpl(Name name)
|
protected |
FunctionExpressionImpl(Name name,
Literal fallback)
Creates a new instance of FunctionExpression |
protected |
FunctionExpressionImpl(String name)
|
protected |
FunctionExpressionImpl(String name,
Literal fallback)
Creates a new instance of FunctionExpression |
Method Summary | |
---|---|
Object |
accept(ExpressionVisitor visitor,
Object extraData)
Accepts a visitor. |
boolean |
equals(Object obj)
|
protected static FunctionName |
functionName(String name,
String ret,
String... args)
Convenience method for creating a function name. |
int |
getArgCount()
Gets the number of arguments that are set. |
Expression[] |
getArgs()
Deprecated. use getParameters() . |
protected Expression |
getExpression(int index)
Utility method for subclasses to ask for an argument at a given index |
Literal |
getFallbackValue()
The value of the fallbackValue attribute is used as a default value, if the SE implementation does not support the function. |
FunctionName |
getFunctionName()
Access to the FunctionName description as used in a FilterCapabilities document. |
Map<RenderingHints.Key,?> |
getImplementationHints()
Returns the implementation hints. |
String |
getName()
Gets the name of this function. |
List<Expression> |
getParameters()
Returns the function parameters. |
short |
getType()
Gets the type of this expression. |
void |
setArgs(Expression[] args)
Deprecated. use setParameters(List) |
void |
setFallbackValue(Literal fallback)
|
void |
setName(String name)
Sets the name of the function. |
void |
setParameters(List params)
Sets the function parameters. |
String |
toString()
Creates a String representation of this Function with the function name and the arguments. |
Methods inherited from class DefaultExpression |
---|
accept, evaluate, evaluate, getValue, isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression, isMathExpression |
Methods inherited from class ExpressionAbstract |
---|
eval, eval, evaluate |
Methods inherited from class Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface Expression |
---|
accept, evaluate, getValue |
Methods inherited from interface Expression |
---|
evaluate, evaluate |
Field Detail |
---|
protected String name
protected List<Expression> params
protected Literal fallback
protected FunctionName functionName
Constructor Detail |
---|
protected FunctionExpressionImpl(FunctionName functionName)
Recommended use:
import static org.geotools.filter.capability.FunctionNameImpl.*; public class AreaFunction extends FunctionExpressionImpl { public static FunctionName NAME = new FunctionNameImpl("Area", parameter("area",Double.class), parameter("geometry",Geometry.class)); public AreaFunction() { super(NAME); }
functionName
- FunctionName describing subclassprotected FunctionExpressionImpl(String name)
protected FunctionExpressionImpl(Name name)
protected FunctionExpressionImpl(String name, Literal fallback)
protected FunctionExpressionImpl(Name name, Literal fallback)
Method Detail |
---|
public short getType()
getType
in interface FunctionExpression
getType
in class DefaultExpression
public String getName()
getName
in interface FunctionExpression
getName
in interface Function
public FunctionName getFunctionName()
Function
getFunctionName
in interface Function
public void setName(String name)
public Literal getFallbackValue()
Function
getFallbackValue
in interface Function
public void setFallbackValue(Literal fallback)
public List<Expression> getParameters()
getParameters
in interface Function
public void setParameters(List params)
setParameters
in interface FunctionExpression
public Expression[] getArgs()
getParameters()
.
getArgs
in interface FunctionExpression
public void setArgs(Expression[] args)
setParameters(List)
setArgs
in interface FunctionExpression
args
- an array of expressions to be evaluated.public int getArgCount()
getArgCount
in interface FunctionExpression
public Object accept(ExpressionVisitor visitor, Object extraData)
Expression
return visitor.visit(this, extraData);
accept
in interface Expression
Expression.accept(ExpressionVisitor, Object)
public Map<RenderingHints.Key,?> getImplementationHints()
getImplementationHints
in interface Factory
protected static FunctionName functionName(String name, String ret, String... args)
FunctionImpl.functionName(String, String, String...)
public String toString()
toString
in class Object
protected Expression getExpression(int index)
index
-
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |