T
- public class NearestVisitor extends Object implements FeatureCalc, FeatureAttributeVisitor
Constructor and Description |
---|
NearestVisitor(Expression expression,
Object valueToMatch)
Creates a NearestVisitor instance for the given attribute and a value to match.
|
Modifier and Type | Method and Description |
---|---|
Expression |
getExpression()
Expression used to access collection content.
|
List<Expression> |
getExpressions()
List of expressions used by visitor.
|
Object |
getNearestMatch()
Returns the match after
visit(org.opengis.feature.Feature) . |
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 |
getValueToMatch()
Provided value to match against.
|
void |
reset() |
void |
setValue(Comparable nearest) |
void |
setValue(Comparable maxBelow,
Comparable minAbove) |
void |
visit(Feature feature)
Visitor function, which looks at each feature and finds the value of the attribute given
attribute nearest to the given comparison value.
|
public NearestVisitor(Expression expression, Object valueToMatch)
valueToMatch
- The target value to matchpublic void visit(Feature feature)
visit
in interface FeatureVisitor
feature
- the feature to be visitedpublic void reset()
public void setValue(Comparable nearest)
public void setValue(Comparable maxBelow, Comparable minAbove)
public Object getNearestMatch() throws IllegalStateException
visit(org.opengis.feature.Feature)
.IllegalStateException
public CalcResult getResult()
FeatureCalc
getResult
in interface FeatureCalc
public Expression getExpression()
public Object getValueToMatch()
public List<Expression> getExpressions()
FeatureAttributeVisitor
getExpressions
in interface FeatureAttributeVisitor
public Optional<List<Class>> getResultType(List<Class> inputTypes)
FeatureAttributeVisitor
getResultType
in interface FeatureAttributeVisitor
inputTypes
- The type of the input expressionsCopyright © 1996–2022 Geotools. All rights reserved.