Class TLcdOGCFunction
- All Implemented Interfaces:
ILcdDataObject
,ILcdGenericExpression
,ILcdOGCCondition
,ILcdOGCExpression
,ILcdCloneable
,ILcdDeepCloneable
,Cloneable
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
.
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructor.TLcdOGCFunction
(String aName) Constructs an instance with a given function name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addArgument
(ILcdOGCExpression aExpression) Adds an argument to the argument list of the function.boolean
getArgument
(int aIndex) Gets the argument of the function at a given position.int
Gets the count of arguments of the function.Returns the list of arguments for this function.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
Sets the name of the function.toString()
Methods inherited from class com.luciad.datamodel.TLcdDataObject
clone, clone, getDataType, getValue, getValue, hasValue, hasValue, setValue, setValue
-
Constructor Details
-
TLcdOGCFunction
public TLcdOGCFunction()Default constructor. -
TLcdOGCFunction
Constructs an instance with a given function name.- Parameters:
aName
- the name of the function
-
-
Method Details
-
getName
Gets the name of the function.- Returns:
- the name of the function.
-
setName
Sets the name of the function.- Parameters:
aName
- the name of the function.
-
removeArgument
Removes a given argument from the argument list of the function.- Parameters:
aExpression
- the argument to be removed from the argument list of the function.- Returns:
- true if
aExpression
was an argument of the function; false otherwise.
-
getArguments
Returns the list of arguments for this function.- Returns:
- the list of arguments
-
insertArgumentAt
Inserts an argument to the argument list of the function at a given position.- Parameters:
aExpression
- the argument to be inserted.aIndex
- the index of the given position.
-
addArgument
Adds an argument to the argument list of the function.- Parameters:
aExpression
- the argument to be added.
-
getArgumentCount
public int getArgumentCount()Gets the count of arguments of the function.- Returns:
- the count of arguments of the function.
-
getArgument
Gets the argument of the function at a given position.- Parameters:
aIndex
- the index of the given position.- Returns:
- the argument at a given position.
-
toString
- Overrides:
toString
in classTLcdDataObject
- Returns:
- a String version of the function's name and its arguments.
-
equals
-
hashCode
public int hashCode()
-