org.geotools.filter
Class FunctionExpressionImpl

Object
  extended by ExpressionAbstract
      extended by DefaultExpression
          extended by FunctionExpressionImpl
All Implemented Interfaces:
Factory, ExpressionType, FunctionExpression, Expression, Function
Direct Known Subclasses:
AreaFunction, ClassifyFunction, Collection_AverageFunction, Collection_BoundsFunction, Collection_CountFunction, Collection_MaxFunction, Collection_MedianFunction, Collection_MinFunction, Collection_SumFunction, Collection_UniqueFunction, FallbackFunction, FilterFunction_abs, FilterFunction_abs_2, FilterFunction_abs_3, FilterFunction_abs_4, FilterFunction_acos, FilterFunction_area, FilterFunction_asin, FilterFunction_atan, FilterFunction_atan2, FilterFunction_between, FilterFunction_boundary, FilterFunction_boundaryDimension, FilterFunction_buffer, FilterFunction_bufferWithSegments, FilterFunction_ceil, FilterFunction_centroid, FilterFunction_contains, FilterFunction_Convert, FilterFunction_convexHull, FilterFunction_cos, FilterFunction_crosses, FilterFunction_dateFormat, FilterFunction_dateParse, FilterFunction_difference, FilterFunction_dimension, FilterFunction_disjoint, FilterFunction_distance, FilterFunction_double2bool, FilterFunction_endPoint, FilterFunction_envelope, FilterFunction_equalsExact, FilterFunction_equalsExactTolerance, FilterFunction_equalTo, FilterFunction_exp, FilterFunction_exteriorRing, FilterFunction_floor, FilterFunction_geometryType, FilterFunction_geomFromWKT, FilterFunction_geomLength, FilterFunction_getGeometryN, FilterFunction_getX, FilterFunction_getY, FilterFunction_getZ, FilterFunction_greaterEqualThan, FilterFunction_greaterThan, FilterFunction_IEEEremainder, FilterFunction_if_then_else, FilterFunction_in10, FilterFunction_in2, FilterFunction_in3, FilterFunction_in4, FilterFunction_in5, FilterFunction_in6, FilterFunction_in7, FilterFunction_in8, FilterFunction_in9, FilterFunction_int2bbool, FilterFunction_int2ddouble, FilterFunction_interiorPoint, FilterFunction_interiorRingN, FilterFunction_intersection, FilterFunction_intersects, FilterFunction_isClosed, FilterFunction_isEmpty, FilterFunction_isLike, FilterFunction_isNull, FilterFunction_isRing, FilterFunction_isSimple, FilterFunction_isValid, FilterFunction_isWithinDistance, FilterFunction_lessEqualThan, FilterFunction_lessThan, FilterFunction_log, FilterFunction_max, FilterFunction_max_2, FilterFunction_max_3, FilterFunction_max_4, FilterFunction_min, FilterFunction_min_2, FilterFunction_min_3, FilterFunction_min_4, FilterFunction_not, FilterFunction_notEqualTo, FilterFunction_numberFormat, FilterFunction_numGeometries, FilterFunction_numInteriorRing, FilterFunction_numPoints, FilterFunction_overlaps, FilterFunction_parseBoolean, FilterFunction_parseDouble, FilterFunction_parseInt, FilterFunction_parseLong, FilterFunction_pointN, FilterFunction_pow, FilterFunction_random, FilterFunction_relate, FilterFunction_relatePattern, FilterFunction_rint, FilterFunction_round, FilterFunction_round_2, FilterFunction_roundDouble, FilterFunction_sin, FilterFunction_sqrt, FilterFunction_startPoint, FilterFunction_strConcat, FilterFunction_strEndsWith, FilterFunction_strEqualsIgnoreCase, FilterFunction_strIndexOf, FilterFunction_strLastIndexOf, FilterFunction_strLength, FilterFunction_strMatches, FilterFunction_strReplace, FilterFunction_strStartsWith, FilterFunction_strSubstring, FilterFunction_strSubstringStart, FilterFunction_strToLowerCase, FilterFunction_strToUpperCase, FilterFunction_strTrim, FilterFunction_symDifference, FilterFunction_tan, FilterFunction_toDegrees, FilterFunction_toRadians, FilterFunction_touches, FilterFunction_toWKT, FilterFunction_union, FilterFunction_within, IDFunction, LengthFunction, MaxFunction, MinFunction, PaletteFunction, PiFunction, PropertyExistsFunction

public abstract class FunctionExpressionImpl
extends DefaultExpression
implements FunctionExpression

Abstract class for a function expression implementation

Author:
James Macgill, PSU
Module:
modules/library/main (gt-main.jar)

Field Summary
protected  Literal fallback
           
protected  String name
          function name
protected  List params
          function params
 
Fields inherited from class DefaultExpression
expressionType, permissiveConstruction
 
Fields inherited from interface ExpressionType
ATTRIBUTE, ATTRIBUTE_DOUBLE, ATTRIBUTE_GEOMETRY, ATTRIBUTE_INTEGER, ATTRIBUTE_STRING, ATTRIBUTE_UNDECLARED, FUNCTION, LITERAL_DOUBLE, LITERAL_GEOMETRY, LITERAL_INTEGER, LITERAL_LONG, LITERAL_STRING, LITERAL_UNDECLARED, MATH_ADD, MATH_DIVIDE, MATH_MULTIPLY, MATH_SUBTRACT
 
Fields inherited from interface Expression
NIL
 
Fields inherited from interface Expression
NIL
 
Constructor Summary
protected FunctionExpressionImpl(String name)
           
protected FunctionExpressionImpl(String name, Literal fallback)
          Creates a new instance of FunctionExpression
 
Method Summary
 Object accept(ExpressionVisitor visitor, Object extraData)
           
 boolean equals(Object obj)
           
abstract  int getArgCount()
          Gets the number of arguments that are set.
 Expression[] getArgs()
          Deprecated. use getParameters().
protected  Expression getExpression(int index)
          Utility method for subclasses to ask for an argument at a given index
 Literal getFallbackValue()
           
 Map getImplementationHints()
          Returns the implementation hints.
 String getName()
          Gets the name of this function.
 List getParameters()
          Returns the function parameters.
 short getType()
          Gets the type of this expression.
 void setArgs(Expression[] args)
          Deprecated. use setParameters(List)
 void setFallbackValue(Literal fallback)
           
 void setName(String name)
          Sets the name of the function.
 void setParameters(List params)
          Sets the function parameters.
 String toString()
          Creates a String representation of this Function with the function name and the arguments.
 
Methods inherited from class DefaultExpression
accept, evaluate, evaluate, getValue, isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression, isMathExpression
 
Methods inherited from class ExpressionAbstract
eval, eval, evaluate
 
Methods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Expression
accept, evaluate, getValue
 
Methods inherited from interface Expression
evaluate, evaluate
 
Methods inherited from interface Expression
evaluate, evaluate
 

Field Detail

name

protected String name
function name


params

protected List params
function params


fallback

protected Literal fallback
Constructor Detail

FunctionExpressionImpl

protected FunctionExpressionImpl(String name)

FunctionExpressionImpl

protected FunctionExpressionImpl(String name,
                                 Literal fallback)
Creates a new instance of FunctionExpression

Method Detail

getType

public short getType()
Gets the type of this expression.

Specified by:
getType in interface FunctionExpression
Overrides:
getType in class DefaultExpression
Returns:
the short representation of a function expression.

getName

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

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

setName

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


getFallbackValue

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

setFallbackValue

public void setFallbackValue(Literal fallback)

getParameters

public List getParameters()
Returns the function parameters.

Specified by:
getParameters in interface Function

setParameters

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

Specified by:
setParameters in interface FunctionExpression

getArgs

public Expression[] getArgs()
Deprecated. use getParameters().

Since this class is heavily subclasses within the geotools toolkit itself we relax the 'final' restriction of this deprecated method.

Specified by:
getArgs in interface FunctionExpression
Returns:
an array of the args to be evaluated.

setArgs

public void setArgs(Expression[] args)
Deprecated. use setParameters(List)

Since this class is heavily subclassed within the geotools toolkit itself we relax the 'final' restriction of this deprecated method.

Specified by:
setArgs in interface FunctionExpression
Parameters:
args - an array of expressions to be evaluated.

getArgCount

public abstract int getArgCount()
Gets the number of arguments that are set.

Specified by:
getArgCount in interface FunctionExpression
Returns:
the number of args.

accept

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

getImplementationHints

public Map getImplementationHints()
Returns the implementation hints. The default implementation returns an empty map.

Specified by:
getImplementationHints in interface Factory
Returns:
The map of hints, or an empty map if none.

toString

public String toString()
Creates a String representation of this Function with the function name and the arguments. The String created should be good for most subclasses

Overrides:
toString in class Object

getExpression

protected Expression getExpression(int index)
Utility method for subclasses to ask for an argument at a given index

Parameters:
index -
Returns:

equals

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


Copyright © 1996-2009 Geotools. All Rights Reserved.