|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectExpressionAbstract
DefaultExpression
ClassificationFunction
public abstract class ClassificationFunction
Parent for classifiers which break a feature collection into the specified number of classes.
Field Summary | |
---|---|
protected static Logger |
LOGGER
|
Fields inherited from class DefaultExpression |
---|
expressionType, permissiveConstruction |
Fields inherited from interface 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 Expression |
---|
NIL |
Fields inherited from interface Expression |
---|
NIL |
Constructor Summary | |
---|---|
ClassificationFunction()
Creates a new instance of ClassificationFunction. |
Method Summary | |
---|---|
Object |
accept(ExpressionVisitor visitor,
Object extraData)
Subclass should override, default implementation just returns extraData |
protected int |
decimalPlaces(double slotWidth)
Determines the number of decimal places to truncate the interval at. |
abstract Object |
evaluate(Object arg)
This method checks if the object is an instance of Feature and
if so, calls through to #evaluate(Feature) . |
Object |
evaluate(SimpleFeature feature)
Returns a value for this expression. |
protected double |
fixRound(double value,
int decimalPlaces,
boolean up)
Corrects a round off operation by incrementing or decrementing the decimal place (preferably the smallest one). |
abstract int |
getArgCount()
Returns the number of arguments this |
Expression[] |
getArgs()
Deprecated. please use getParameters |
int |
getClasses()
|
Expression |
getExpression()
|
Literal |
getFallbackValue()
|
Map |
getImplementationHints()
Returns the implementation hints. |
String |
getName()
Gets the name of this function. |
int |
getNumberOfClasses()
Deprecated. use getClasses() |
List |
getParameters()
Returns the function parameters (the contents are Expressions, usually attribute expression and literal expression). |
ProgressListener |
getProgressListener()
|
protected double |
round(double value,
int decimalPlaces)
Truncates a double to a certain number of decimals places. |
void |
setArgs(Expression[] args)
Deprecated. please use setParameters |
void |
setClasses(int classes)
|
void |
setExpression(Expression e)
|
void |
setFallbackValue(Literal fallback)
|
void |
setName(String name)
Sets the name of the function. |
void |
setNumberOfClasses(int classes)
Deprecated. use setClasses() |
void |
setParameters(List params)
Sets the function parameters. |
void |
setProgressListener(ProgressListener progress)
|
Methods inherited from class DefaultExpression |
---|
accept, getType, getValue, isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression, isMathExpression |
Methods inherited from class ExpressionAbstract |
---|
eval, eval, evaluate |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface FunctionExpression |
---|
getType |
Methods inherited from interface Expression |
---|
accept, getValue |
Methods inherited from interface Expression |
---|
evaluate |
Methods inherited from interface Expression |
---|
evaluate |
Field Detail |
---|
protected static final Logger LOGGER
Constructor Detail |
---|
public ClassificationFunction()
Method Detail |
---|
public abstract int getArgCount()
FunctionExpression
getArgCount
in interface FunctionExpression
public Object accept(ExpressionVisitor visitor, Object extraData)
ExpressionAbstract
accept
in interface Expression
accept
in class ExpressionAbstract
Expression.accept(ExpressionVisitor, Object)
public Object evaluate(SimpleFeature feature)
DefaultExpression
evaluate
in class DefaultExpression
feature
- Specified feature to use when returning value.
public abstract Object evaluate(Object arg)
DefaultExpression
Feature
and
if so, calls through to #evaluate(Feature)
. This is done
to maintain backwards compatability with previous version of Expression api
which depended on Feature. If the object is not an instance of feature
the super implementation is called.
evaluate
in interface Expression
evaluate
in class DefaultExpression
public void setFallbackValue(Literal fallback)
public Literal getFallbackValue()
getFallbackValue
in interface Function
public Expression[] getArgs()
FunctionExpression
getArgs
in interface FunctionExpression
public void setArgs(Expression[] args)
FunctionExpression
setArgs
in interface FunctionExpression
args
- an array of expressions to be evaluated.public String getName()
getName
in interface FunctionExpression
getName
in interface Function
public void setName(String name)
public List getParameters()
getParameters
in interface Function
public void setParameters(List params)
setParameters
in interface FunctionExpression
public ProgressListener getProgressListener()
public void setProgressListener(ProgressListener progress)
public int getNumberOfClasses()
public int getClasses()
public void setNumberOfClasses(int classes)
public void setClasses(int classes)
public Expression getExpression()
public void setExpression(Expression e)
public Map getImplementationHints()
getImplementationHints
in interface Factory
protected int decimalPlaces(double slotWidth)
slotWidth
- protected double round(double value, int decimalPlaces)
value
- number to round-offdecimalPlaces
- number of decimal places to leave
protected double fixRound(double value, int decimalPlaces, boolean up)
value
- decimalPlaces
- up
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |