|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FeatureResultSet
Provides access to the results of a Query
operation.
The primary means of accessing the individual result features is to use the Iterable.iterator()
method and
subsequently call it's Iterator.next()
methods. Depending on the implementation (e.g. when backed by an SQL
result set), this enables the processing of arbitrary large numbers of results without causing memory issues. Also,
it's essential to ensure that the close()
method is called afterwards, or resource leaks may occur (e.g.
open SQL result sets).
A typical use of a FeatureResultSet
looks like this:
... FeatureResultSet rs = null; try { // retrieve the FeatureResultSet rs = ... for ( Feature f : rs ) { // do something with the feature // ... } } finally { // make sure that the FeatureResultSet always gets closed if ( rs != null ) { rs.close(); } } ...
Method Summary | |
---|---|
void |
close()
Must be invoked after using to close underlying resources, e.g. |
FeatureCollection |
toCollection()
Returns all members of the FeatureResultSet as a FeatureCollection . |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Method Detail |
---|
void close()
ResultSet
s.
FeatureCollection toCollection()
FeatureResultSet
as a FeatureCollection
.
NOTE: This method should not be called for very large result sets, as it introduces the overhead of keeping all
created feature instances in memory. The returned collection will contain all Feature
s instances from the
current position in the iteration sequence.
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |