| java.lang.Object org.geotools.feature.iso.FeatureCollectionIteration
FeatureCollectionIteration | public class FeatureCollectionIteration (Code) | | The FeatureCollectionIteration provides a depth first traversal of a
FeatureCollection which will call the provided call-back Handler. Because
of the complex nature of Features, which may have other Features (or even a
collection of Features) as attributes, the handler is repsonsible for
maintaining its own state as to where in the traversal it is recieving
events from. Many handlers will not need to worry about state.
Implementation Notes: The depth first visitation is implemented
through recursion. The limits to recursion depending on the settings in the
JVM, but some tests show a 2 argument recursive having a limit of ~50000
method calls with a stack size of 512k (the standard setting).
author: Ian Schneider, USDA-ARS author: Chris Holmes, TOPP |
Inner Class :public interface Handler | |
Field Summary | |
final protected Handler | handler A callback handler for the iteration of the contents of a
FeatureCollection. |
Constructor Summary | |
public | FeatureCollectionIteration(Handler handler, FeatureCollection collection) Create a new FeatureCollectionIteration with the given handler and
collection. |
Method Summary | |
public void | iterate() Start the iteration. | protected void | iterate(Iterator iterator) Perform the actual iteration on the Iterator which is provided. | public static void | iteration(Handler handler, FeatureCollection collection) A convienience method for obtaining a new iteration and calling iterate. | protected void | walker(FeatureCollection collection) Perform the iterative behavior on the given collection. | protected void | walker(Feature feature) Perform the visitation of an individual Feature. |
handler | final protected Handler handler(Code) | | A callback handler for the iteration of the contents of a
FeatureCollection.
|
FeatureCollectionIteration | public FeatureCollectionIteration(Handler handler, FeatureCollection collection) throws NullPointerException(Code) | | Create a new FeatureCollectionIteration with the given handler and
collection.
Parameters: handler - The handler to perform operations on this iteration. Parameters: collection - The collection to iterate over. throws: NullPointerException - If handler or collection are null. |
iterate | public void iterate()(Code) | | Start the iteration.
|
iterate | protected void iterate(Iterator iterator)(Code) | | Perform the actual iteration on the Iterator which is provided.
Parameters: iterator - The Iterator to iterate upon. |
iteration | public static void iteration(Handler handler, FeatureCollection collection)(Code) | | A convienience method for obtaining a new iteration and calling iterate.
Parameters: handler - The handler to perform operations on this iteration. Parameters: collection - The collection to iterate over. |
walker | protected void walker(FeatureCollection collection)(Code) | | Perform the iterative behavior on the given collection. This will alert
the handler with a handleFeatureCollection call, followed
by an iterate() , followed by a
handler.endFeatureCollection() call.
Parameters: collection - The collection to iterate upon. |
walker | protected void walker(Feature feature)(Code) | | Perform the visitation of an individual Feature.
Parameters: feature - The Feature to explore. |
|
|