org.deegree.feature.stream
Class CombinedFeatureInputStream

java.lang.Object
  extended by org.deegree.feature.stream.CombinedFeatureInputStream
All Implemented Interfaces:
Iterable<Feature>, FeatureInputStream

public class CombinedFeatureInputStream
extends Object
implements FeatureInputStream

FeatureInputStream that encapsulates a sequence of FeatureInputStreams.

Version:
$Revision: 32037 $, $Date: 2011-09-29 14:24:24 +0200 (Thu, 29 Sep 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Constructor Summary
CombinedFeatureInputStream(Iterator<FeatureInputStream> resultSetIter)
          Creates a new CombinedFeatureInputStream that is backed by the given FeatureInputStream.
 
Method Summary
 void close()
          Must be invoked after using to close underlying resources, e.g.
 int count()
          Counts the remaining features in the stream (and consumes them) and closes it.
 Iterator<Feature> iterator()
           
 FeatureCollection toCollection()
          Returns all members of the FeatureInputStream as a FeatureCollection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinedFeatureInputStream

public CombinedFeatureInputStream(Iterator<FeatureInputStream> resultSetIter)
Creates a new CombinedFeatureInputStream that is backed by the given FeatureInputStream.

Parameters:
resultSetIter - FeatureResultSet to back the result set, must not be null
Method Detail

close

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

Specified by:
close in interface FeatureInputStream

toCollection

public FeatureCollection toCollection()
Description copied from interface: FeatureInputStream
Returns all members of the FeatureInputStream 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 FeatureInputStream
Returns:
members as feature collection, never null

iterator

public Iterator<Feature> iterator()
Specified by:
iterator in interface Iterable<Feature>

count

public int count()
Description copied from interface: FeatureInputStream
Counts the remaining features in the stream (and consumes them) and closes it.

Specified by:
count in interface FeatureInputStream
Returns:
number of remaining features


Copyright © 2011. All Rights Reserved.