public class DelegateFeatureReader<T extends FeatureType,F extends Feature> extends Object implements FeatureReader<T,F>
This class is useful for faking (and testing) the Resource based API against in memory datastructures. You are warned that to complete the illusion that Resource based IO is occuring content will be duplicated.
Constructor and Description |
---|
DelegateFeatureReader(T featureType,
FeatureIterator<F> features) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Release the underlying resources associated with this stream.
|
T |
getFeatureType()
Return the FeatureType this reader has been configured to create.
|
boolean |
hasNext()
Query whether this FeatureReader has another Feature.
|
F |
next()
Reads the next Feature in the FeatureReader.
|
public DelegateFeatureReader(T featureType, FeatureIterator<F> features)
public T getFeatureType()
FeatureReader
getFeatureType
in interface FeatureReader<T extends FeatureType,F extends Feature>
public F next() throws IOException, IllegalAttributeException, NoSuchElementException
FeatureReader
next
in interface FeatureReader<T extends FeatureType,F extends Feature>
IOException
- If an error occurs reading the Feature.IllegalAttributeException
- If the attributes read do not comply with the FeatureType.NoSuchElementException
- If there are no more Features in the Reader.public boolean hasNext() throws IOException
FeatureReader
hasNext
in interface FeatureReader<T extends FeatureType,F extends Feature>
IOException
- If an error occurs determining if there are more Features.public void close() throws IOException
FeatureReader
close
in interface Closeable
close
in interface AutoCloseable
close
in interface FeatureReader<T extends FeatureType,F extends Feature>
IOException
- if an I/O error occursCopyright © 1996–2019 Geotools. All rights reserved.