Class CollectionFeatureSource.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
  • Constructor Details

  • Method Details

    • 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:

      
       collection.subCollection( filter ).clear();
       
      The above recommended use is agreement with the Collections API precident of List.subList( start, end ).

      The results of subCollection:

      • are to be considered unordered
      • may be an ordered FeatureList if requested when sortBy is indicated
      Specified by:
      subCollection in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
      Specified by:
      subCollection in interface SimpleFeatureCollection
      Overrides:
      subCollection in class DecoratingSimpleFeatureCollection
      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 interface FeatureCollection<SimpleFeatureType,SimpleFeature>
      Specified by:
      sort in interface SimpleFeatureCollection
      Overrides:
      sort in class DecoratingSimpleFeatureCollection
      Parameters:
      order - Sort order
      Returns:
      FeatureCollection sorted in the indicated order