public class AverageVisitor extends Object implements FeatureCalc, FeatureAttributeVisitor
| Modifier and Type | Class and Description |
|---|---|
static class |
AverageVisitor.AverageResult |
| Constructor and Description |
|---|
AverageVisitor(Expression expr)
Constructor class for the AverageVisitor using an expression
|
AverageVisitor(int attributeTypeIndex,
SimpleFeatureType type)
Constructor class for the AverageVisitor using AttributeDescriptor ID
|
AverageVisitor(String attrName,
SimpleFeatureType type)
Constructor class for the AverageVisitor using AttributeDescriptor Name
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getAverage()
Returns the average from the visitor's current
|
Expression |
getExpression() |
List<Expression> |
getExpressions()
List of expressions used by visitor.
|
CalcResult |
getResult()
Returns a CalcResult object (containing the Average)
|
void |
init(SimpleFeatureCollection collection) |
void |
reset()
Resets the "Average" strategy pattern
|
void |
setValue(int newCount,
Object newSum) |
void |
setValue(Object newAverage) |
void |
visit(Feature feature)
Visit the provided feature.
|
void |
visit(SimpleFeature feature) |
public AverageVisitor(int attributeTypeIndex,
SimpleFeatureType type)
throws IllegalFilterException
attributeTypeIndex - integer representing the AttributeDescriptortype - FeatureTypeIllegalFilterExceptionpublic AverageVisitor(String attrName, SimpleFeatureType type) throws IllegalFilterException
attrName - string respresenting the AttributeDescriptortype - FeatureTypeIllegalFilterExceptionpublic AverageVisitor(Expression expr) throws IllegalFilterException
expr - IllegalFilterExceptionpublic void init(SimpleFeatureCollection collection)
public List<Expression> getExpressions()
FeatureAttributeVisitorgetExpressions in interface FeatureAttributeVisitorpublic 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 getAverage()
public void reset()
public CalcResult getResult()
getResult in interface FeatureCalcpublic void setValue(Object newAverage)
public void setValue(int newCount,
Object newSum)
Copyright © 1996–2019 Geotools. All rights reserved.