public class TLcdOGCFunction extends TLcdDataObject implements ILcdOGCExpression, ILcdOGCCondition
This class represents the <ogc:Function>
element.
According to the OGC Filter specification, a function is a named procedure that performs a distinct computation. A function may accept zero or more arguments as input and generates a single result.
You can use a function as an ILcdOGCCondition
if it evaluates to a boolean result value (null corresponds to false).
This is equivalent to:
If you use a function as condition, but it evaluates to anything else, you will get errors while evaluating.eq
(function
(FUNCTION_NAME, ...),literal
(true))
A TLcdOGCFunction
instance is composed of the name of the function, and zero or more arguments that can be
any instances of ILcdOGCExpression
.
When you create OGC filters containing a custom function, you must make sure the ILcdOGCFilterEvaluator
used
to evaluate the OGC filter can handle this custom function.
For the default evaluator (TLcdOGCFilterEvaluator
), this is achieved by calling
TLcdOGCFilterEvaluator.registerFunction(TLcdXMLName, ILcdEvaluatorFunction)
for each custom function.
A set of predefined vendor-specific functions are available out-of-the-box: see TLcdOGCVendorSpecificFunctions
.
ILcdOGCExpression
,
TLcdOGCVendorSpecificFunctions
Constructor and Description |
---|
TLcdOGCFunction()
Default constructor.
|
TLcdOGCFunction(String aName)
Constructs an instance with a given function name.
|
Modifier and Type | Method and Description |
---|---|
void |
addArgument(ILcdOGCExpression aExpression)
Adds an argument to the argument list of the function.
|
boolean |
equals(Object obj) |
ILcdOGCExpression |
getArgument(int aIndex)
Gets the argument of the function at a given position.
|
int |
getArgumentCount()
Gets the count of arguments of the function.
|
List<ILcdOGCExpression> |
getArguments()
Returns the list of arguments for this function.
|
String |
getName()
Gets the name of the function.
|
int |
hashCode() |
void |
insertArgumentAt(ILcdOGCExpression aExpression,
int aIndex)
Inserts an argument to the argument list of the function at a given position.
|
boolean |
removeArgument(ILcdOGCExpression aExpression)
Removes a given argument from the argument list of the function.
|
void |
setName(String aName)
Sets the name of the function.
|
String |
toString() |
clone, clone, getDataType, getValue, getValue, hasValue, hasValue, setValue, setValue
public TLcdOGCFunction()
public TLcdOGCFunction(String aName)
aName
- the name of the functionpublic String getName()
public void setName(String aName)
aName
- the name of the function.public boolean removeArgument(ILcdOGCExpression aExpression)
aExpression
- the argument to be removed from the argument list of the function.aExpression
was an argument of the function; false otherwise.public List<ILcdOGCExpression> getArguments()
public void insertArgumentAt(ILcdOGCExpression aExpression, int aIndex)
aExpression
- the argument to be inserted.aIndex
- the index of the given position.public void addArgument(ILcdOGCExpression aExpression)
aExpression
- the argument to be added.public int getArgumentCount()
public ILcdOGCExpression getArgument(int aIndex)
aIndex
- the index of the given position.public String toString()
toString
in class TLcdDataObject