public class FeatureCollectionIteration extends Object
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).
| Modifier and Type | Class and Description |
|---|---|
static interface |
FeatureCollectionIteration.Handler
A callback handler for the iteration of the contents of a FeatureCollection.
|
| Modifier and Type | Field and Description |
|---|---|
protected FeatureCollectionIteration.Handler |
handler
A callback handler for the iteration of the contents of a FeatureCollection.
|
| Constructor and Description |
|---|
FeatureCollectionIteration(FeatureCollectionIteration.Handler handler,
FeatureCollection<?,?> collection)
Create a new FeatureCollectionIteration with the given handler and collection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
iterate()
Start the iteration.
|
protected void |
iterate(FeatureIterator<?> iterator)
Perform the actual iteration on the Iterator which is provided.
|
static void |
iteration(FeatureCollectionIteration.Handler handler,
FeatureCollection<?,?> collection)
A convienience method for obtaining a new iteration and calling iterate.
|
protected void |
walker(Feature feature)
Perform the visitation of an individual Feature.
|
protected void |
walker(FeatureCollection<?,?> collection)
Perform the iterative behavior on the given collection.
|
protected final FeatureCollectionIteration.Handler handler
public FeatureCollectionIteration(FeatureCollectionIteration.Handler handler, FeatureCollection<?,?> collection) throws NullPointerException
handler - The handler to perform operations on this iteration.collection - The collection to iterate over.NullPointerException - If handler or collection are null.public static void iteration(FeatureCollectionIteration.Handler handler, FeatureCollection<?,?> collection)
handler - The handler to perform operations on this iteration.collection - The collection to iterate over.public void iterate()
protected void walker(FeatureCollection<?,?> collection)
handleFeatureCollection call, followed by an iterate(), followed
by a handler.endFeatureCollection() call.collection - The collection to iterate upon.protected void iterate(FeatureIterator<?> iterator)
iterator - The Iterator to iterate upon.protected void walker(Feature feature)
feature - The Feature to explore.Copyright © 1996–2019 Geotools. All rights reserved.