org.geotools.feature.visitor
Class MinVisitor

java.lang.Object
  extended byorg.geotools.feature.visitor.MinVisitor
All Implemented Interfaces:
FeatureCalc, FeatureVisitor

public class MinVisitor
extends java.lang.Object
implements FeatureCalc

Calculates the minimum value of an attribute.

Since:
2.2.M2
Author:
Cory Horner, Refractions

Nested Class Summary
static class MinVisitor.MinResult
           
 
Constructor Summary
MinVisitor(Expression expr)
           
MinVisitor(int attributeTypeIndex, FeatureType type)
           
MinVisitor(java.lang.String attrName, FeatureType type)
           
 
Method Summary
 Expression getExpression()
           
 java.lang.Comparable getMin()
          Get the min value.
 CalcResult getResult()
          Returns the result of the calculation as a handy object which can be merged and modified.
 void reset()
           
 void setValue(java.lang.Object result)
          Overwrites the result stored by the visitor.
 void visit(Feature feature)
          Visitor function, which looks at each feature and finds the minimum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinVisitor

public MinVisitor(int attributeTypeIndex,
                  FeatureType type)
           throws IllegalFilterException

MinVisitor

public MinVisitor(java.lang.String attrName,
                  FeatureType type)
           throws IllegalFilterException

MinVisitor

public MinVisitor(Expression expr)
           throws IllegalFilterException
Method Detail

visit

public void visit(Feature feature)
Visitor function, which looks at each feature and finds the minimum.

Specified by:
visit in interface FeatureVisitor
Parameters:
feature - the feature to be visited

getMin

public java.lang.Comparable getMin()
Get the min value.

Returns:
Minimum value
Throws:
java.lang.IllegalStateException - DOCUMENT ME!

reset

public void reset()

getResult

public CalcResult getResult()
Description copied from interface: FeatureCalc
Returns the result of the calculation as a handy object which can be merged and modified.

Specified by:
getResult in interface FeatureCalc
Returns:
the results of the calculation

getExpression

public Expression getExpression()

setValue

public void setValue(java.lang.Object result)
Overwrites the result stored by the visitor. This should only be used by optimizations which will tell the visitor the answer rather than visiting all features.

For 'min', the value stored is of type 'Comparable'.

Parameters:
result -


Copyright © GeoTools. All Rights Reserved.