org.deegree.feature.persistence.query
Class ThreadedResultSet

java.lang.Object
  extended by org.deegree.feature.persistence.query.ThreadedResultSet
All Implemented Interfaces:
java.lang.Iterable<Feature>, FeatureResultSet

public class ThreadedResultSet
extends java.lang.Object
implements FeatureResultSet

FeatureResultSet that uses a separate thread to keep an internal queue of features filled.

Version:
$Revision: $, $Date: $
Author:
Markus Schneider, last edited by: $Author: schneider $

Constructor Summary
ThreadedResultSet(FeatureResultSet rs, int maxFill, int minFill)
          Creates a new ThreadedResultSet based on the given FeatureResultSet that uses the given thread to keep the internal queue of results filled.
 
Method Summary
 void close()
          Must be invoked after using to close underlying resources, e.g.
 java.util.Iterator<Feature> iterator()
           
 FeatureCollection toCollection()
          Returns all members of the FeatureResultSet as a FeatureCollection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadedResultSet

public ThreadedResultSet(FeatureResultSet rs,
                         int maxFill,
                         int minFill)
Creates a new ThreadedResultSet based on the given FeatureResultSet that uses the given thread to keep the internal queue of results filled.

Parameters:
rs -
maxFill -
minFill -
Method Detail

close

public void close()
Description copied from interface: FeatureResultSet
Must be invoked after using to close underlying resources, e.g. SQL ResultSets.

Specified by:
close in interface FeatureResultSet

toCollection

public FeatureCollection toCollection()
Description copied from interface: FeatureResultSet
Returns all members of the 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 Features instances from the current position in the iteration sequence.

Specified by:
toCollection in interface FeatureResultSet
Returns:
members as feature collection, never null

iterator

public java.util.Iterator<Feature> iterator()
Specified by:
iterator in interface java.lang.Iterable<Feature>


Copyright © 2011. All Rights Reserved.