|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.filter.ConstantExpression
public class ConstantExpression
The Expression class is not immutable!
However we do have a need for immutable literal expressions when defining our API for SLD, and any other standards based on Expression.
Field Summary | |
---|---|
static ConstantExpression |
BLACK
|
static ConstantExpression |
NULL
|
static ConstantExpression |
ONE
|
static ConstantExpression |
TWO
|
static ConstantExpression |
UNNAMED
|
static ConstantExpression |
ZERO
|
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 |
ConstantExpression(java.lang.Object value)
|
protected |
ConstantExpression(short type,
java.lang.Object value)
|
Method Summary | ||
---|---|---|
java.lang.Object |
accept(org.opengis.filter.expression.ExpressionVisitor visitor,
java.lang.Object extraData)
|
|
void |
accept(FilterVisitor visitor)
Deprecated. use accept(ExpressionVisitor, Object) . |
|
protected java.lang.Object |
clone()
|
|
static ConstantExpression |
color(java.awt.Color color)
Encode provided color as a String |
|
static ConstantExpression |
constant(double number)
|
|
static ConstantExpression |
constant(int number)
|
|
static ConstantExpression |
constant(java.lang.Object value)
|
|
boolean |
equals(java.lang.Object obj)
|
|
java.lang.Object |
evaluate(java.lang.Object object)
|
|
|
evaluate(java.lang.Object object,
java.lang.Class<T> context)
|
|
java.lang.Object |
evaluate(org.opengis.feature.simple.SimpleFeature feature)
Evaluates the expression against an instance of Feature . |
|
java.lang.Object |
getLiteral()
Deprecated. use getValue() |
|
short |
getType()
Returns the literal type. |
|
java.lang.Object |
getValue()
|
|
java.lang.Object |
getValue(org.opengis.feature.simple.SimpleFeature feature)
Deprecated. use #evaluate(Feature) |
|
int |
hashCode()
|
|
void |
setLiteral(java.lang.Object literal)
Deprecated. use setValue(Object) |
|
void |
setValue(java.lang.Object constant)
|
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ConstantExpression NULL
public static final ConstantExpression BLACK
public static final ConstantExpression ZERO
public static final ConstantExpression ONE
public static final ConstantExpression TWO
public static final ConstantExpression UNNAMED
Constructor Detail |
---|
protected ConstantExpression(java.lang.Object value)
protected ConstantExpression(short type, java.lang.Object value)
Method Detail |
---|
public final void setLiteral(java.lang.Object literal) throws IllegalFilterException
setValue(Object)
LiteralExpression
setLiteral
in interface LiteralExpression
literal
- The literal to store inside this expression.
IllegalFilterException
- This literal type is not in scope.public final java.lang.Object getValue(org.opengis.feature.simple.SimpleFeature feature)
#evaluate(Feature)
LiteralExpression
getValue
in interface LiteralExpression
feature
- Required by the interface but not used.
public java.lang.Object evaluate(org.opengis.feature.simple.SimpleFeature feature)
Expression
Feature
.
feature
- The feature being evaluated.
public java.lang.Object evaluate(java.lang.Object object)
evaluate
in interface org.opengis.filter.expression.Expression
public <T> T evaluate(java.lang.Object object, java.lang.Class<T> context)
evaluate
in interface org.opengis.filter.expression.Expression
public java.lang.Object getValue()
getValue
in interface org.opengis.filter.expression.Literal
public void setValue(java.lang.Object constant)
public short getType()
LiteralExpression
getType
in interface LiteralExpression
public final java.lang.Object getLiteral()
getValue()
LiteralExpression
getLiteral
in interface LiteralExpression
public void accept(FilterVisitor visitor)
accept(ExpressionVisitor, Object)
.
Expression
visitor
- The visitor which requires access to this filter, the
method must call visitor.visit(this);public java.lang.Object accept(org.opengis.filter.expression.ExpressionVisitor visitor, java.lang.Object extraData)
accept
in interface org.opengis.filter.expression.Expression
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static ConstantExpression color(java.awt.Color color)
public static ConstantExpression constant(double number)
public static ConstantExpression constant(int number)
public static ConstantExpression constant(java.lang.Object value)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |