public abstract class ClassificationFunction extends DefaultExpression implements FunctionExpression
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOGGER |
NIL
Constructor and Description |
---|
ClassificationFunction(FunctionName name) |
Modifier and Type | Method and Description |
---|---|
Object |
accept(ExpressionVisitor visitor,
Object extraData)
Accepts a visitor.
|
protected double[] |
computeGroupByPercentages(FeatureCollection collection,
double[] percentages,
int totalSize,
double min,
double classWidth)
This method return percentages by using a single groupBy query to retrieve class members.
|
protected void |
computePercentage(double[] percentages,
double classMembers,
double totalSize,
int index)
Compute the percentage from the input parameters, setting in the percentages array at the
specified index
|
protected int |
decimalPlaces(double slotWidth)
Determines the number of decimal places to truncate the interval at.
|
abstract Object |
evaluate(Object arg)
Subclass should override, default implementation returns null.
|
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 |
getClasses() |
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<RenderingHints.Key,?> |
getImplementationHints()
Returns the implementation hints.
|
String |
getName()
Gets the name of this function.
|
List<Expression> |
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 |
setClasses(int classes) |
void |
setFallbackValue(Literal fallback)
Fallback value to use in the event the function is unavailable in the requested environment.
|
void |
setParameters(List<Expression> params)
Sets the function parameters.
|
void |
setProgressListener(ProgressListener progress) |
String |
toString()
Creates a String representation of this Function with the function name and the arguments.
|
isAttributeExpression, isExpression, isFunctionExpression, isGeometryExpression, isLiteralExpression, isMathExpression
evaluate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
evaluate
protected static final Logger LOGGER
public ClassificationFunction(FunctionName name)
public Object accept(ExpressionVisitor visitor, Object extraData)
Expression
return visitor.visit(this, extraData);
accept
in interface Expression
Expression.accept(ExpressionVisitor, Object)
public abstract Object evaluate(Object arg)
ExpressionAbstract
evaluate
in interface Expression
evaluate
in class ExpressionAbstract
public void setFallbackValue(Literal fallback)
FunctionExpression
The fallback value is not provided as one of the arguments, as it is an advanced option used in style layer descriptor documents to facilitate interoperability. It allows a user to specify an SQL function, and provide a value to use when the documented is used with a WFS that does not support the provided function.
setFallbackValue
in interface FunctionExpression
public Literal getFallbackValue()
Function
getFallbackValue
in interface Function
public String getName()
public FunctionName getFunctionName()
Function
getFunctionName
in interface Function
public List<Expression> getParameters()
getParameters
in interface Function
public void setParameters(List<Expression> params)
setParameters
in interface FunctionExpression
public ProgressListener getProgressListener()
public void setProgressListener(ProgressListener progress)
public int getClasses()
public void setClasses(int classes)
public Map<RenderingHints.Key,?> getImplementationHints()
getImplementationHints
in interface Factory
protected int decimalPlaces(double slotWidth)
protected double round(double value, int decimalPlaces)
value
- number to round-offdecimalPlaces
- number of decimal places to leaveprotected double fixRound(double value, int decimalPlaces, boolean up)
public String toString()
protected double[] computeGroupByPercentages(FeatureCollection collection, double[] percentages, int totalSize, double min, double classWidth) throws IOException
collection
- the feature collection to classifypercentages
- the array of percentages to filltotalSize
- the totalSize of the collectionmin
- the min attribute value in the collectionclassWidth
- the classWidthIOException
protected void computePercentage(double[] percentages, double classMembers, double totalSize, int index)
Copyright © 1996–2023 Geotools. All rights reserved.