org.geotools.filter
Class FunctionImpl

Object
  extended by ExpressionAbstract
      extended by FunctionImpl
All Implemented Interfaces:
Expression, Function
Direct Known Subclasses:
ConcatenateFunction

public class FunctionImpl
extends ExpressionAbstract
implements Function

Default implementation of a Function; you may extend this class to implement specific functionality.

Author:
Cory Horner, Refractions Research
Module:
modules/library/main (gt-main.jar)

Field Summary
 
Fields inherited from interface Expression
NIL
 
Constructor Summary
FunctionImpl()
           
 
Method Summary
 Object accept(ExpressionVisitor visitor, Object extraData)
           
 Object evaluate(Object object)
          Default implementation simply returns the fallbackValue.
 Literal getFallbackValue()
           
 String getName()
          Gets the name of this function.
 List<Expression> getParameters()
          Returns the function parameters.
 void setFallbackValue(Literal fallbackValue)
           
 void setName(String name)
          Sets the name of the function.
 void setParameters(List<Expression> params)
          Sets the function parameters.
 
Methods inherited from class ExpressionAbstract
eval, eval, evaluate
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Expression
evaluate
 

Constructor Detail

FunctionImpl

public FunctionImpl()
Method Detail

getName

public String getName()
Gets the name of this function.

Specified by:
getName in interface Function
Returns:
the name of the function.

setName

public void setName(String name)
Sets the name of the function.


getParameters

public List<Expression> getParameters()
Returns the function parameters.

Specified by:
getParameters in interface Function

evaluate

public Object evaluate(Object object)
Default implementation simply returns the fallbackValue.

Please override this method to produce a value based on the provided arguments.

Specified by:
evaluate in interface Expression
Overrides:
evaluate in class ExpressionAbstract
Parameters:
object - Object being evaluated; often a Feature
Returns:
value for the provided object

setParameters

public void setParameters(List<Expression> params)
Sets the function parameters.


setFallbackValue

public void setFallbackValue(Literal fallbackValue)

getFallbackValue

public Literal getFallbackValue()
Specified by:
getFallbackValue in interface Function

accept

public Object accept(ExpressionVisitor visitor,
                     Object extraData)
Specified by:
accept in interface Expression


Copyright © 1996-2010 Geotools. All Rights Reserved.