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 protected
SubCollection(Query query, SimpleFeatureCollection features)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleFeatureCollection
sort(SortBy order)
Obtained sorted contents.SimpleFeatureCollection
subCollection(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:FeatureCollection
SimpleFeatureCollection "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:
subCollection
in interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
subCollection
in interfaceSimpleFeatureCollection
- Overrides:
subCollection
in classDecoratingSimpleFeatureCollection
- Returns:
- SimpleFeatureCollection identified as subset.
- See Also:
FeatureList
-
sort
public SimpleFeatureCollection sort(SortBy order)
Description copied from interface:FeatureCollection
Obtained sorted contents.This method may not be supported by all implementations, consider the use of FeatureSource.features( Query ).
- Specified by:
sort
in interfaceFeatureCollection<SimpleFeatureType,SimpleFeature>
- Specified by:
sort
in interfaceSimpleFeatureCollection
- Overrides:
sort
in classDecoratingSimpleFeatureCollection
- Parameters:
order
- Sort order- Returns:
- FeatureCollection sorted in the indicated order
-
-