|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.filter.expression.Function
public class Function
Generic Function
implementation that can be used to represent an arbitrary function, but that doesn't offer
any evaluation capabilities (this is added by subclassing).
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.deegree.filter.Expression |
---|
Expression.Type |
Constructor Summary | |
---|---|
Function(String name,
List<Expression> params)
Creates a new Function instance. |
Method Summary | ||
---|---|---|
TypedObjectNode[] |
evaluate(List<TypedObjectNode[]> args)
Evaluates the function for the given arguments (without a context object). |
|
protected
|
evaluate(T obj,
List<TypedObjectNode[]> args)
Evaluates the function for the given arguments and context. |
|
|
evaluate(T obj,
XPathEvaluator<T> xpathEvaluator)
Determines the values of the expression for the given context object. |
|
String |
getName()
Returns the name of the function. |
|
List<Expression> |
getParameters()
Returns the parameters of the function. |
|
Expression[] |
getParams()
Returns the expression's paramters. |
|
Expression.Type |
getType()
Always returns Expression.Type#FUNCTION . |
|
String |
toString(String indent)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Function(String name, List<Expression> params)
Function
instance.
name
- name of the function, must not be null
params
- parameters of the function, may be empty, but never null
Method Detail |
---|
public String getName()
null
public Expression.Type getType()
Expression.Type#FUNCTION
.
getType
in interface Expression
Expression.Type#FUNCTION
public List<Expression> getParameters()
null
public TypedObjectNode[] evaluate(List<TypedObjectNode[]> args) throws FilterEvaluationException
The double-dimension of input arguments is due to the fact that input arguments usually stem from
XPath-evaluation performed on a TypedObjectNode
(e.g. a Feature
). Therefore, multiple values per
input may occur. The outer list contains one entry per parameter, the inner array contain the values for each
parameter. Depending on the type of function it may return multiple outputs as well.
args
- input arguments, must match the parameter signature, can be empty, but never null
null
FilterEvaluationException
protected <T> TypedObjectNode[] evaluate(T obj, List<TypedObjectNode[]> args) throws FilterEvaluationException
If the function requires information from the context object for performing the computation, this method must be overridden.
obj
- context object, must not be null
args
- input arguments, must match the parameter signature, can be empty, but never null
null
FilterEvaluationException
public <T> TypedObjectNode[] evaluate(T obj, XPathEvaluator<T> xpathEvaluator) throws FilterEvaluationException
Expression
Note that this returns an TypedObjectNode[]
, as an expression may evaluate to multiple values, e.g.
a ValueReference
that targets a multi property of a feature.
evaluate
in interface Expression
T
- type of the context objectobj
- object that the expression is evaluated upon, must not be null
xpathEvaluator
- used for evaluation of XPath expressions, must not be null
null
values), but never
null
FilterEvaluationException
public String toString(String indent)
toString
in interface Expression
public Expression[] getParams()
Expression
getParams
in interface Expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |