org.geotools.filter
Class FunctionExpressionImpl

java.lang.Object
  extended by org.geotools.filter.expression.ExpressionAbstract
      extended by org.geotools.filter.DefaultExpression
          extended by org.geotools.filter.FunctionExpressionImpl
All Implemented Interfaces:
Factory, ExpressionType, FunctionExpression, org.opengis.filter.expression.Expression, org.opengis.filter.expression.Function
Direct Known Subclasses:
AreaFunction, AsMultiGeometryFunctionExpression, ClassifyFunction, Collection_AverageFunction, Collection_BoundsFunction, Collection_CountFunction, Collection_MaxFunction, Collection_MedianFunction, Collection_MinFunction, Collection_SumFunction, Collection_UniqueFunction, EnvFunction, 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_isometric, 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_offset, 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_strCapitalize, 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_vertices, FilterFunction_within, IDFunction, IDFunctionExpression, 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

Field Summary
protected  org.opengis.filter.expression.Literal fallback
           
protected  java.lang.String name
          function name
protected  java.util.List params
          function params
 
Fields inherited from class org.geotools.filter.DefaultExpression
expressionType, permissiveConstruction
 
Fields inherited from interface org.geotools.filter.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 org.opengis.filter.expression.Expression
NIL
 
Constructor Summary
protected FunctionExpressionImpl(java.lang.String name)
           
protected FunctionExpressionImpl(java.lang.String name, org.opengis.filter.expression.Literal fallback)
          Creates a new instance of FunctionExpression
 
Method Summary
 java.lang.Object accept(org.opengis.filter.expression.ExpressionVisitor visitor, java.lang.Object extraData)
           
 boolean equals(java.lang.Object obj)
           
abstract  int getArgCount()
          Gets the number of arguments that are set.
 Expression[] getArgs()
          Deprecated. use getParameters().
protected  org.opengis.filter.expression.Expression getExpression(int index)
          Utility method for subclasses to ask for an argument at a given index
 org.opengis.filter.expression.Literal getFallbackValue()
           
 java.util.Map getImplementationHints()
          Returns the implementation hints.
 java.lang.String getName()
          Gets the name of this function.
 java.util.List getParameters()
          Returns the function parameters.
 short getType()
          Gets the type of this expression.
 void setArgs(Expression[] args)
          Deprecated. use setParameters(List)
 void setFallbackValue(org.opengis.filter.expression.Literal fallback)
           
 void setName(java.lang.String name)
          Sets the name of the function.
 void setParameters(java.util.List params)
          Sets the function parameters.
 java.lang.String toString()
          Creates a String representation of this Function with the function name and the arguments.
 
Methods inherited from class org.geotools.filter.DefaultExpression
accept, evaluate, evaluate, getValue, isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression, isMathExpression
 
Methods inherited from class org.geotools.filter.expression.ExpressionAbstract
eval, eval, evaluate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.filter.Expression
accept, evaluate, getValue
 
Methods inherited from interface org.opengis.filter.expression.Expression
evaluate, evaluate
 

Field Detail

name

protected java.lang.String name
function name


params

protected java.util.List params
function params


fallback

protected org.opengis.filter.expression.Literal fallback
Constructor Detail

FunctionExpressionImpl

protected FunctionExpressionImpl(java.lang.String name)

FunctionExpressionImpl

protected FunctionExpressionImpl(java.lang.String name,
                                 org.opengis.filter.expression.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 java.lang.String getName()
Gets the name of this function.

Specified by:
getName in interface FunctionExpression
Specified by:
getName in interface org.opengis.filter.expression.Function
Returns:
the name of the function.

setName

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


getFallbackValue

public org.opengis.filter.expression.Literal getFallbackValue()
Specified by:
getFallbackValue in interface org.opengis.filter.expression.Function

setFallbackValue

public void setFallbackValue(org.opengis.filter.expression.Literal fallback)

getParameters

public java.util.List getParameters()
Returns the function parameters.

Specified by:
getParameters in interface org.opengis.filter.expression.Function

setParameters

public void setParameters(java.util.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 java.lang.Object accept(org.opengis.filter.expression.ExpressionVisitor visitor,
                               java.lang.Object extraData)
Specified by:
accept in interface org.opengis.filter.expression.Expression
See Also:
Expression.accept(ExpressionVisitor, Object)

getImplementationHints

public java.util.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 java.lang.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 java.lang.Object

getExpression

protected org.opengis.filter.expression.Expression getExpression(int index)
Utility method for subclasses to ask for an argument at a given index

Parameters:
index -
Returns:

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.