|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.feature.FeatureResultsIteration
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).
Nested Class Summary | |
static interface |
FeatureResultsIteration.Handler
A callback handler for the iteration of the contents of a FeatureCollection. |
Field Summary | |
protected FeatureResultsIteration.Handler |
handler
A callback handler for the iteration of the contents of a FeatureCollection. |
Constructor Summary | |
FeatureResultsIteration(FeatureResultsIteration.Handler handler,
org.geotools.data.FeatureResults features)
Create a new FeatureResultsIteration with the given handler and collection. |
Method Summary | |
void |
iterate()
Start the iteration. |
protected void |
iterate(org.geotools.data.FeatureReader reader)
Perform the actual iteration on the Iterator which is provided. |
static void |
iteration(FeatureResultsIteration.Handler handler,
org.geotools.data.FeatureResults features)
A convienience method for obtaining a new iteration and calling iterate. |
protected void |
walker(org.geotools.feature.Feature feature)
Perform the visitation of an individual Feature. |
protected void |
walker(org.geotools.data.FeatureResults results,
org.geotools.data.FeatureReader reader)
Perform the iterative behavior on the given collection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final FeatureResultsIteration.Handler handler
Constructor Detail |
public FeatureResultsIteration(FeatureResultsIteration.Handler handler, org.geotools.data.FeatureResults features) throws java.lang.NullPointerException, java.io.IOException
handler
- The handler to perform operations on this iteration.features
- The collection to iterate over.
java.lang.NullPointerException
- If handler or collection are null.
java.io.IOException
- DOCUMENT ME!Method Detail |
public static void iteration(FeatureResultsIteration.Handler handler, org.geotools.data.FeatureResults features) throws java.io.IOException
handler
- The handler to perform operations on this iteration.features
- The collection to iterate over.
java.io.IOException
- DOCUMENT ME!public void iterate() throws java.io.IOException
java.io.IOException
- DOCUMENT ME!protected void walker(org.geotools.data.FeatureResults results, org.geotools.data.FeatureReader reader) throws java.io.IOException
handleFeatureCollection
call, followed
by an iterate()
, followed by a
handler.endFeatureCollection()
call.
results
- The collection to iterate upon.reader
- DOCUMENT ME!
java.io.IOException
- DOCUMENT ME!
org.geotools.data.DataSourceException
- DOCUMENT ME!protected void iterate(org.geotools.data.FeatureReader reader) throws java.io.IOException, org.geotools.feature.IllegalAttributeException
reader
- The Iterator to iterate upon.
java.io.IOException
- DOCUMENT ME!
IllegalAttributeException
- DOCUMENT ME!protected void walker(org.geotools.feature.Feature feature)
feature
- The Feature to explore.
java.lang.UnsupportedOperationException
- DOCUMENT ME!
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |