Package com.vividsolutions.jump.io
Class BaseFeatureInputStream
- java.lang.Object
-
- com.vividsolutions.jump.io.BaseFeatureInputStream
-
- All Implemented Interfaces:
FeatureInputStream
- Direct Known Subclasses:
SpatialDatabasesFeatureInputStream
public abstract class BaseFeatureInputStream extends 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
Constructors Constructor Description BaseFeatureInputStream()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidclose()abstract FeatureSchemagetFeatureSchema()booleanhasNext()Featurenext()protected abstract FeaturereadNext()Read the next feature, if any.
-
-
-
Method Detail
-
getFeatureSchema
public abstract FeatureSchema getFeatureSchema()
- Specified by:
getFeatureSchemain interfaceFeatureInputStream
-
next
public Feature next() throws Exception
- Specified by:
nextin interfaceFeatureInputStream- Throws:
Exception
-
hasNext
public boolean hasNext() throws Exception- Specified by:
hasNextin interfaceFeatureInputStream- Throws:
Exception
-
readNext
protected abstract Feature readNext() throws Exception
Read the next feature, if any.- Returns:
- the next Feature, or
nullif there is none - Throws:
Exception- if an exception occured while reading next Feature
-
close
public abstract void close() throws Exception- Specified by:
closein interfaceFeatureInputStream- Throws:
Exception
-
-