|
||||||||||
| 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 |
| Constructor Summary | |
|---|---|
ClassificationFunction(FunctionName name)
|
|
| Method Summary | |
|---|---|
Object |
accept(ExpressionVisitor visitor,
Object extraData)
Accepts a visitor. |
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). |
int |
getArgCount()
Returns the number of arguments this |
Expression[] |
getArgs()
Deprecated. please use getParameters |
int |
getClasses()
|
Expression |
getExpression()
|
Literal |
getFallbackValue()
The value of the fallbackValue attribute is used as a default value, if the SE implementation does not support the function. |
FunctionName |
getFunctionName()
Access to the FunctionName description as used in a FilterCapabilities document. |
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 |
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 |
| Field Detail |
|---|
protected static final Logger LOGGER
| Constructor Detail |
|---|
public ClassificationFunction(FunctionName name)
| Method Detail |
|---|
public int getArgCount()
FunctionExpression
getArgCount in interface FunctionExpression
public Object accept(ExpressionVisitor visitor,
Object extraData)
Expressionreturn visitor.visit(this, extraData);
accept in interface ExpressionExpression.accept(ExpressionVisitor, Object)public Object evaluate(SimpleFeature feature)
DefaultExpression
evaluate in class DefaultExpressionfeature - Specified feature to use when returning value.
public abstract Object evaluate(Object arg)
DefaultExpressionFeature 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 Expressionevaluate in class DefaultExpressionpublic void setFallbackValue(Literal fallback)
public Literal getFallbackValue()
Function
getFallbackValue in interface Functionpublic Expression[] getArgs()
FunctionExpression
getArgs in interface FunctionExpressionpublic void setArgs(Expression[] args)
FunctionExpression
setArgs in interface FunctionExpressionargs - an array of expressions to be evaluated.public String getName()
getName in interface FunctionExpressiongetName in interface Functionpublic FunctionName getFunctionName()
Function
getFunctionName in interface Functionpublic List getParameters()
getParameters in interface Functionpublic void setParameters(List params)
setParameters in interface FunctionExpressionpublic 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 Factoryprotected 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 | |||||||||