public class SumVisitor extends Object implements FeatureCalc, FeatureAttributeVisitor
| Modifier and Type | Class and Description |
|---|---|
static class |
SumVisitor.SumResult |
protected static interface |
SumVisitor.SumStrategy |
| Constructor and Description |
|---|
SumVisitor(Expression expr) |
SumVisitor(int attributeTypeIndex,
SimpleFeatureType type) |
SumVisitor(String attrName,
SimpleFeatureType type) |
| Modifier and Type | Method and Description |
|---|---|
Expression |
getExpression() |
List<Expression> |
getExpressions()
List of expressions used by visitor.
|
CalcResult |
getResult()
Returns the result of the calculation as a handy object which can be merged and modified.
|
Optional<List<Class>> |
getResultType(List<Class> inputTypes)
Returns the expected output type given the input type.
|
Object |
getSum() |
void |
init(SimpleFeatureCollection collection) |
void |
reset() |
protected void |
setStrategy(SumVisitor.SumStrategy strategy) |
void |
setValue(Object newSum) |
void |
visit(Feature feature)
Visit the provided feature.
|
void |
visit(SimpleFeature feature) |
public SumVisitor(int attributeTypeIndex,
SimpleFeatureType type)
throws IllegalFilterException
IllegalFilterExceptionpublic SumVisitor(String attrName, SimpleFeatureType type) throws IllegalFilterException
IllegalFilterExceptionpublic SumVisitor(Expression expr) throws IllegalFilterException
IllegalFilterExceptionprotected void setStrategy(SumVisitor.SumStrategy strategy)
public void init(SimpleFeatureCollection collection)
public List<Expression> getExpressions()
FeatureAttributeVisitorgetExpressions in interface FeatureAttributeVisitorpublic Optional<List<Class>> getResultType(List<Class> inputTypes)
FeatureAttributeVisitorgetResultType in interface FeatureAttributeVisitorinputTypes - The type of the input expressionspublic void visit(SimpleFeature feature)
public void visit(Feature feature)
FeatureVisitorPlease consult the documentation for the FeatureCollection you are visiting to learn more - the provided feature may be invalid, or read only.
visit in interface FeatureVisitorpublic Expression getExpression()
public Object getSum()
public void setValue(Object newSum)
public void reset()
public CalcResult getResult()
FeatureCalcgetResult in interface FeatureCalcCopyright © 1996–2021 Geotools. All rights reserved.