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
- FeatureTypeIllegalFilterException
public AverageVisitor(String attrName, SimpleFeatureType type) throws IllegalFilterException
attrName
- string respresenting the AttributeDescriptortype
- FeatureTypeIllegalFilterException
public AverageVisitor(Expression expr) throws IllegalFilterException
expr
- IllegalFilterException
public void init(SimpleFeatureCollection collection)
public List<Expression> getExpressions()
FeatureAttributeVisitor
getExpressions
in interface FeatureAttributeVisitor
public void visit(SimpleFeature feature)
public void visit(Feature feature)
FeatureVisitor
Please consult the documentation for the FeatureCollection you are visiting to learn more - the provided feature may be invalid, or read only.
visit
in interface FeatureVisitor
public Expression getExpression()
public Object getAverage()
public void reset()
public CalcResult getResult()
getResult
in interface FeatureCalc
public void setValue(Object newAverage)
public void setValue(int newCount, Object newSum)
Copyright © 1996–2019 Geotools. All rights reserved.