|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.filter.DefaultExpression
org.geotools.filter.MathExpressionImpl
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.
Field Summary |
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_STRING, MATH_ADD, MATH_DIVIDE, MATH_MULTIPLY, MATH_SUBTRACT |
Constructor Summary | |
protected |
MathExpressionImpl()
No argument constructor. |
protected |
MathExpressionImpl(short expType)
Constructor with expression type. |
Method Summary | |
void |
accept(FilterVisitor visitor)
Used by FilterVisitors to perform some action on this filter instance. |
void |
addLeftValue(Expression leftValue)
Adds the 'left' value to this expression. |
void |
addRightValue(Expression rightValue)
Adds the 'right' value to this expression. |
boolean |
equals(java.lang.Object obj)
Compares this expression to the specified object. |
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. |
int |
hashCode()
Override of hashCode method. |
java.lang.String |
toString()
Returns a string representation of this expression |
Methods inherited from class org.geotools.filter.DefaultExpression |
isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected MathExpressionImpl()
protected MathExpressionImpl(short expType) throws IllegalFilterException
expType
- The mathematical relationship between values.
IllegalFilterException
- Attempting to declare illegal type.Method Detail |
public void addLeftValue(Expression leftValue) throws IllegalFilterException
addLeftValue
in interface MathExpression
leftValue
- Expression to add to this expression.
IllegalFilterException
- Attempting to add non-math expression.public void addRightValue(Expression rightValue) throws IllegalFilterException
addRightValue
in interface MathExpression
rightValue
- Expression to add to this expression.
IllegalFilterException
- Attempting to add non-math expression.public Expression getLeftValue()
getLeftValue
in interface MathExpression
public Expression getRightValue()
getRightValue
in interface MathExpression
public short getType()
getType
in interface MathExpression
getType
in class DefaultExpression
public java.lang.Object getValue(Feature feature) throws java.lang.IllegalArgumentException
getValue
in interface MathExpression
getValue
in class DefaultExpression
feature
- Feature to use when return sub expression values.
java.lang.IllegalArgumentException
- Feature does not match declared schema.public java.lang.String toString()
public boolean equals(java.lang.Object obj)
obj
- - the object to compare this ExpressionLiteral against.
public int hashCode()
public void accept(FilterVisitor visitor)
accept
in interface Expression
visitor
- The visitor which requires access to this filter, the
method must call visitor.visit(this);
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |