com.vividsolutions.jump.io
Class BaseFeatureInputStream

java.lang.Object
  extended bycom.vividsolutions.jump.io.BaseFeatureInputStream
All Implemented Interfaces:
FeatureInputStream
Direct Known Subclasses:
PostgisFeatureInputStream

public abstract class BaseFeatureInputStream
extends java.lang.Object
implements FeatureInputStream

Base class for FeatureInputStreamReaders. Handles the details of buffering the stream of features to allow for lookahead. This allows subclasses to implement the simpler semantics of "return null if no more features". Subclasses need to define readNext and close. They also need to set the featureSchema instance variable.


Constructor Summary
BaseFeatureInputStream()
           
 
Method Summary
abstract  void close()
           
abstract  FeatureSchema getFeatureSchema()
           
 boolean hasNext()
           
 Feature next()
           
protected abstract  Feature readNext()
          Read the next feature, if any.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseFeatureInputStream

public BaseFeatureInputStream()
Method Detail

getFeatureSchema

public abstract FeatureSchema getFeatureSchema()
Specified by:
getFeatureSchema in interface FeatureInputStream

next

public Feature next()
             throws java.lang.Exception
Specified by:
next in interface FeatureInputStream
Throws:
java.lang.Exception

hasNext

public boolean hasNext()
                throws java.lang.Exception
Specified by:
hasNext in interface FeatureInputStream
Throws:
java.lang.Exception

readNext

protected abstract Feature readNext()
                             throws java.lang.Exception
Read the next feature, if any.

Returns:
the next Feature, or null if there is none
Throws:
java.lang.Exception

close

public abstract void close()
                    throws java.lang.Exception
Specified by:
close in interface FeatureInputStream
Throws:
java.lang.Exception