Class TLcdOGCFunction

java.lang.Object
com.luciad.datamodel.TLcdDataObject
com.luciad.ogc.filter.model.TLcdOGCFunction
All Implemented Interfaces:
ILcdDataObject, ILcdGenericExpression, ILcdOGCCondition, ILcdOGCExpression, ILcdCloneable, ILcdDeepCloneable, Cloneable

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:

   eq(function(FUNCTION_NAME, ...), literal(true))
 
If you use a function as condition, but it evaluates to anything else, you will get errors while evaluating.

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 Details

    • TLcdOGCFunction

      public TLcdOGCFunction()
      Default constructor.
    • TLcdOGCFunction

      public TLcdOGCFunction(String aName)
      Constructs an instance with a given function name.
      Parameters:
      aName - the name of the function
  • Method Details

    • getName

      public String getName()
      Gets the name of the function.
      Returns:
      the name of the function.
    • setName

      public void setName(String aName)
      Sets the name of the function.
      Parameters:
      aName - the name of the function.
    • removeArgument

      public boolean removeArgument(ILcdOGCExpression aExpression)
      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

      public List<ILcdOGCExpression> getArguments()
      Returns the list of arguments for this function.
      Returns:
      the list of arguments
    • insertArgumentAt

      public void insertArgumentAt(ILcdOGCExpression aExpression, int aIndex)
      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

      public void addArgument(ILcdOGCExpression aExpression)
      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

      public ILcdOGCExpression getArgument(int aIndex)
      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

      public String toString()
      Overrides:
      toString in class TLcdDataObject
      Returns:
      a String version of the function's name and its arguments.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object