01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.filter;
17:
18: import org.opengis.filter.expression.BinaryExpression;
19: import org.geotools.feature.Feature;
20:
21: /**
22: * Holds a mathematical relationship between two expressions. Note that the sub
23: * expressions must be math expressions. In other words, they must be a math
24: * literal, another math expression, or a feature attribute with a declared
25: * math type. You may create math expressions of arbitrary complexity by
26: * nesting other math expressions as sub expressions in one or more math
27: * expressions. This filter defines left and right values to clarify the sub
28: * expression precedence for non-associative operations, such as subtraction
29: * and division. For example, the left value is the numerator and the right is
30: * the denominator in an ExpressionMath division operation.
31: *
32: * @author Rob Hranac, Vision for New York
33: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/filter/MathExpression.java $
34: * @version $Id: MathExpression.java 22294 2006-10-20 00:55:40Z desruisseaux $
35: *
36: * @deprecated use {@link org.opengis.filter.expression.BinaryExpression}
37: */
38: public interface MathExpression extends Expression, BinaryExpression {
39: /**
40: * Returns the value for this expression.
41: *
42: * @param feature Feature to use when return sub expression values.
43: *
44: * @return Value of this expression.
45: *
46: * @deprecated use {@link Expression#evaluate(Feature)}.
47: *
48: */
49: Object getValue(Feature feature);
50:
51: /**
52: * Adds the 'right' value to this expression.
53: *
54: * @param rightValue Expression to add to this expression.
55: *
56: * @throws IllegalFilterException Attempting to add non-math expression.
57: *
58: * @deprecated use {@link BinaryExpression#setExpression2(Expression)}
59: */
60: void addRightValue(Expression rightValue)
61: throws IllegalFilterException;
62:
63: /**
64: * Gets the type of this expression.
65: *
66: * @return Expression type.
67: * @deprecated The expression type system has been replaced by an actual
68: * class type system.
69: */
70: short getType();
71:
72: /**
73: * Gets the left expression.
74: *
75: * @return the expression on the left of the comparison.
76: * @deprecated use {@link BinaryExpression#getExpression1()}.
77: */
78: Expression getLeftValue();
79:
80: /**
81: * Gets the right expression.
82: *
83: * @return the expression on the right of the comparison.
84: * @deprecated use {@link BinaryExpression#getExpression2()}.
85: */
86: Expression getRightValue();
87:
88: /**
89: * Adds the 'left' value to this expression.
90: *
91: * @param leftValue Expression to add to this expression.
92: *
93: * @throws IllegalFilterException Attempting to add non-math expression.
94: *
95: * @deprecated use {@link BinaryExpression#setExpression1(Expression)}
96: */
97: void addLeftValue(Expression leftValue)
98: throws IllegalFilterException;
99: }
|