Class CollectionFeatureSource.SubCollection
- Object
-
- DecoratingSimpleFeatureCollection
-
- SubCollection
-
- All Implemented Interfaces:
SimpleFeatureCollection,FeatureCollection<SimpleFeatureType,SimpleFeature>
- Enclosing class:
- CollectionFeatureSource
protected class CollectionFeatureSource.SubCollection extends DecoratingSimpleFeatureCollection
SubCollection for CollectionFeatureSource.Will route any calls refining the feature collection back to CollectionFeatureSource. This is based on the success of ContentFeatureCollection.
- Author:
- Jody
-
-
Field Summary
-
Fields inherited from class DecoratingSimpleFeatureCollection
delegate
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSubCollection(Query query, SimpleFeatureCollection features)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleFeatureCollectionsort(SortBy order)Obtained sorted contents.SimpleFeatureCollectionsubCollection(Filter filter)SimpleFeatureCollection "view" indicated by provided filter.-
Methods inherited from class DecoratingSimpleFeatureCollection
accepts, canDelegate, contains, containsAll, equals, features, getBounds, getID, getSchema, hashCode, isEmpty, size, toArray, toArray
-
-
-
-
Constructor Detail
-
SubCollection
protected SubCollection(Query query, SimpleFeatureCollection features)
-
-
Method Detail
-
subCollection
public SimpleFeatureCollection subCollection(Filter filter)
Description copied from interface:FeatureCollectionSimpleFeatureCollection "view" indicated by provided filter.The contents of the returned SimpleFeatureCollection are determined by applying the provider Filter to the entire contents of this FeatureCollection. The result is "live" and modifications will be shared.
This method is used cut down on the number of filter based methods required for a useful SimpleFeatureCollection construct. The FeatureCollections returned really should be considered as a temporary "view" used to control the range of a removeAll, or modify operation.
Example Use:
The above recommended use is agreement with the Collections API precident of List.subList( start, end ).collection.subCollection( filter ).clear();The results of subCollection:
- are to be considered unordered
- may be an ordered FeatureList if requested when sortBy is indicated
- Specified by:
subCollectionin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>- Specified by:
subCollectionin interfaceSimpleFeatureCollection- Overrides:
subCollectionin classDecoratingSimpleFeatureCollection- Returns:
- SimpleFeatureCollection identified as subset.
- See Also:
FeatureList
-
sort
public SimpleFeatureCollection sort(SortBy order)
Description copied from interface:FeatureCollectionObtained sorted contents.This method may not be supported by all implementations, consider the use of FeatureSource.features( Query ).
- Specified by:
sortin interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>- Specified by:
sortin interfaceSimpleFeatureCollection- Overrides:
sortin classDecoratingSimpleFeatureCollection- Parameters:
order- Sort order- Returns:
- FeatureCollection sorted in the indicated order
-
-