org.geotools.filter
Class DefaultExpression

java.lang.Object
  extended byorg.geotools.filter.DefaultExpression
All Implemented Interfaces:
Expression, ExpressionType
Direct Known Subclasses:
AttributeExpressionImpl, AttributeExpressionImpl2, FunctionExpressionImpl, GeometryExpressionImpl, LiteralExpressionImpl, MapScaleDenominatorImpl, MathExpressionImpl

public abstract class DefaultExpression
extends java.lang.Object
implements Expression

Implements a default expression, with helpful variables and static methods.

Version:
$Id: DefaultExpression.java,v 1.7 2004/04/04 16:01:21 aaime Exp $
Author:
Rob Hranac, Vision for New York

Field Summary
protected  short expressionType
          Defines the type of this expression.
protected  boolean permissiveConstruction
          Defines the type of this expression.
 
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_STRING, MATH_ADD, MATH_DIVIDE, MATH_MULTIPLY, MATH_SUBTRACT
 
Constructor Summary
DefaultExpression()
           
 
Method Summary
 short getType()
          Gets the type of this expression.
 java.lang.Object getValue(Feature feature)
          Returns a value for this expression.
protected static boolean isAttributeExpression(short expressionType)
          Checks to see if passed type is attribute.
protected static boolean isExpression(short expressionType)
          Checks to see if passed type is geometry.
protected static boolean isFunctionExpression(short expressionType)
          Returns true if this is a expression.
protected static boolean isGeometryExpression(short expressionType)
          Checks to see if passed type is geometry.
protected static boolean isLiteralExpression(short expressionType)
          Checks to see if passed type is geometry.
protected static boolean isMathExpression(short expressionType)
          Checks to see if passed type is math.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.filter.Expression
accept
 

Field Detail

expressionType

protected short expressionType
Defines the type of this expression.


permissiveConstruction

protected boolean permissiveConstruction
Defines the type of this expression.

Constructor Detail

DefaultExpression

public DefaultExpression()
Method Detail

getType

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

Specified by:
getType in interface Expression
Returns:
The short representation of the expression type.

getValue

public java.lang.Object getValue(Feature feature)
Returns a value for this expression. If the expression is an attribute expression then the attribute of the feature should be returned. If a literal then the feature is ignored, the literal is returned as it has no relation to the feature.

Specified by:
getValue in interface Expression
Parameters:
feature - Specified feature to use when returning value.
Returns:
The value of this expression based on the feature.
Task:
REVISIT: make abstract?

isAttributeExpression

protected static boolean isAttributeExpression(short expressionType)
Checks to see if passed type is attribute.

Parameters:
expressionType - Type of expression for check.
Returns:
Whether or not this is an attribute expression type.

isMathExpression

protected static boolean isMathExpression(short expressionType)
Checks to see if passed type is math.

Parameters:
expressionType - Type of expression for check.
Returns:
Whether or not this is a math expression type.

isLiteralExpression

protected static boolean isLiteralExpression(short expressionType)
Checks to see if passed type is geometry.

Parameters:
expressionType - Type of expression for check.
Returns:
Whether or not this is a geometry expression type.

isGeometryExpression

protected static boolean isGeometryExpression(short expressionType)
Checks to see if passed type is geometry.

Parameters:
expressionType - Type of expression for check.
Returns:
Whether or not this is a geometry expression type.

isExpression

protected static boolean isExpression(short expressionType)
Checks to see if passed type is geometry.

Parameters:
expressionType - Type of expression for check.
Returns:
Whether or not this is a geometry expression type.

isFunctionExpression

protected static boolean isFunctionExpression(short expressionType)
Returns true if this is a expression.

Parameters:
expressionType -
Returns:


Copyright © GeoTools. All Rights Reserved.