org.geotools.filter
Interface MathExpression

All Superinterfaces:
Expression, ExpressionType
All Known Implementing Classes:
MathExpressionImpl

public interface MathExpression
extends Expression

Holds a mathematical relationship between two expressions. Note that the sub expressions must be math expressions. In other words, they must be a math literal, another math expression, or a feature attribute with a declared math type. You may create math expressions of arbitrary complexity by nesting other math expressions as sub expressions in one or more math expressions. This filter defines left and right values to clarify the sub expression precedence for non-associative operations, such as subtraction and division. For example, the left value is the numerator and the right is the denominator in an ExpressionMath division operation.

Version:
$Id: MathExpression.java 17702 2006-01-23 00:08:55Z desruisseaux $
Author:
Rob Hranac, Vision for New York

Field Summary
 
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
 
Method Summary
 void addLeftValue(Expression leftValue)
          Adds the 'left' value to this expression.
 void addRightValue(Expression rightValue)
          Adds the 'right' value to this expression.
 Expression getLeftValue()
          Gets the left expression.
 Expression getRightValue()
          Gets the right expression.
 short getType()
          Gets the type of this expression.
 java.lang.Object getValue(Feature feature)
          Returns the value for this expression.
 
Methods inherited from interface org.geotools.filter.Expression
accept
 

Method Detail

getValue

public java.lang.Object getValue(Feature feature)
Returns the value for this expression.

Specified by:
getValue in interface Expression
Parameters:
feature - Feature to use when return sub expression values.
Returns:
Value of this expression.

addRightValue

public void addRightValue(Expression rightValue)
                   throws IllegalFilterException
Adds the 'right' value to this expression.

Parameters:
rightValue - Expression to add to this expression.
Throws:
IllegalFilterException - Attempting to add non-math expression.

getType

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

Specified by:
getType in interface Expression
Returns:
Expression type.

getLeftValue

public Expression getLeftValue()
Gets the left expression.

Returns:
the expression on the left of the comparison.

getRightValue

public Expression getRightValue()
Gets the right expression.

Returns:
the expression on the right of the comparison.

addLeftValue

public void addLeftValue(Expression leftValue)
                  throws IllegalFilterException
Adds the 'left' value to this expression.

Parameters:
leftValue - Expression to add to this expression.
Throws:
IllegalFilterException - Attempting to add non-math expression.


Copyright © GeoTools. All Rights Reserved.