|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.MaxFeatureReader
Basic support for a FeatureReader that limits itself to the number of features passed in.
Field Summary | |
protected int |
counter
|
protected FeatureReader |
featureReader
|
protected int |
maxFeatures
|
Constructor Summary | |
MaxFeatureReader(FeatureReader featureReader,
int maxFeatures)
Creates a new instance of MaxFeatureReader |
Method Summary | |
void |
close()
Release the underlying resources associated with this stream. |
FeatureType |
getFeatureType()
Return the FeatureType this reader has been configured to create. |
boolean |
hasNext()
|
Feature |
next()
Reads the next Feature in the FeatureReader. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final FeatureReader featureReader
protected final int maxFeatures
protected int counter
Constructor Detail |
public MaxFeatureReader(FeatureReader featureReader, int maxFeatures)
featureReader
- FeatureReader being maxedmaxFeatures
- DOCUMENT ME!Method Detail |
public Feature next() throws java.io.IOException, IllegalAttributeException, java.util.NoSuchElementException
FeatureReader
next
in interface FeatureReader
java.util.NoSuchElementException
- If there are no more Features in the
Reader.
IllegalAttributeException
- If the attributes read do not comply
with the FeatureType.
java.io.IOException
- If an error occurs reading the Feature.public void close() throws java.io.IOException
FeatureReader
close
in interface FeatureReader
java.io.IOException
- DOCUMENT ME!public FeatureType getFeatureType()
FeatureReader
getFeatureType
in interface FeatureReader
public boolean hasNext() throws java.io.IOException
hasNext
in interface FeatureReader
true
if the featureReader has not passed the max
and still has more features.
java.io.IOException
- If the reader we are filtering encounters a problem
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |