public class ReTypingFeatureCollection extends DecoratingSimpleFeatureCollection
delegate| Constructor and Description |
|---|
ReTypingFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> delegate,
SimpleFeatureType featureType) |
ReTypingFeatureCollection(SimpleFeatureCollection delegate,
SimpleFeatureType featureType) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canDelegate(FeatureVisitor visitor)
Methods for subclass to override in order to determine if the supplied visitor can be passed
to the delegate collection.
|
SimpleFeatureIterator |
features()
Obtain a SimpleFeatureIterator of the Features within this SimpleFeatureCollection.
|
SimpleFeatureType |
getSchema()
The schema for the child feature members of this collection.
|
static boolean |
isTypeCompatible(FeatureVisitor visitor,
SimpleFeatureType featureType)
Checks if the visitor is accessing only properties available in the specified feature type,
or as a special case, if it's a count visitor accessing no properties at all
|
FeatureReader<SimpleFeatureType,SimpleFeature> |
reader() |
accepts, contains, containsAll, equals, getBounds, getID, hashCode, isEmpty, size, sort, subCollection, toArray, toArraypublic ReTypingFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> delegate, SimpleFeatureType featureType)
public ReTypingFeatureCollection(SimpleFeatureCollection delegate, SimpleFeatureType featureType)
public SimpleFeatureType getSchema()
FeatureCollectionRepresents the most general FeatureType in common to all the features in this collection.
getSchema in interface FeatureCollection<SimpleFeatureType,SimpleFeature>getSchema in class DecoratingSimpleFeatureCollectionpublic FeatureReader<SimpleFeatureType,SimpleFeature> reader() throws IOException
IOExceptionpublic SimpleFeatureIterator features()
SimpleFeatureCollectionThe implementation of FeatureIterator must adhere to the rules of fail-fast concurrent
modification. In addition (to allow for resource backed collections) the
SimpleFeatureIterator.close() method must be called.
Example use:
SimpleFeatureIterator iterator=collection.features();
try {
while( iterator.hasNext() ){
SimpleFeature feature = iterator.next();
System.out.println( feature.getID() );
}
}
finally {
iterator.close();
}
features in interface SimpleFeatureCollectionfeatures in interface FeatureCollection<SimpleFeatureType,SimpleFeature>features in class DecoratingSimpleFeatureCollectionprotected boolean canDelegate(FeatureVisitor visitor)
DecoratingSimpleFeatureCollectionThe default is false and the visitor receives the decoraeted features.
canDelegate in class DecoratingSimpleFeatureCollectionpublic static boolean isTypeCompatible(FeatureVisitor visitor, SimpleFeatureType featureType)
visitor - featureType - Copyright © 1996–2019 Geotools. All rights reserved.