Class MappingFeatureCollection

    • Method Detail

      • setUnrolledFilter

        public void setUnrolledFilter​(Filter unrolledFilter)
      • add

        public boolean add​(Feature obj)
        Not a supported operation.
        See Also:
      • addAll

        public boolean addAll​(Collection<? extends Feature> collection)
      • addListener

        public void addListener​(CollectionListener listener)
                         throws NullPointerException
      • clear

        public void clear()
      • close

        public void close​(Iterator<Feature> close)
      • features

        public FeatureIterator<Feature> features()
        Description copied from interface: FeatureCollection
        Obtain a FeatureIterator of the Features within this FeatureCollection.

        The implementation of FeatureIterator must adhere to the rules of fail-fast concurrent modification. In addition (to allow for resource backed collections) the FeatureIterator.close() method must be called.

        Example use:

         FeatureIterator iterator=collection.features();
         try {
             while( iterator.hasNext()  ){
                  Feature feature =;
                  System.out.println( feature.getID() );
         finally {

        GML Note: The contents of this iterator are considered to be defined by featureMember tags (and/or the single allowed FeatureMembers tag). Please see getFeatureType for more details.

        Specified by:
        features in interface FeatureCollection<FeatureType,​Feature>
        A FeatureIterator.
      • features

        public FeatureIterator<Feature> features​(Transaction transaction)
        This overload allows client code to explicitly specify the transaction that the created iterator will be working against.

        Passing null is equivalent to calling features() and lets the iterator decide whether a new transaction should be created (and closed when the iterator is closed) or not. Currently, a new transaction is created by DataAccessMappingFeatureIterator only if a database backend is available and joining is enabled, to reduce the number of concurrent connections opened due to feature chaining.

        transaction - the transaction the created iterator will be working against
        See Also:
      • features

        public XmlMappingFeatureIterator features​(String xpath,
                                                  String value)
                                           throws IOException
      • getSchema

        public FeatureType getSchema()
        Description copied from interface: FeatureCollection
        The schema for the child feature members of this collection.

        Represents the most general FeatureType in common to all the features in this collection.

        • For a collection backed by a shapefiles (or database tables) the FeatureType returned by getSchema() will complete describe each and every child in the collection.
        • For mixed content FeatureCollections you will need to check the FeatureType of each Feature as it is retrived from the collection
        • The degenerate case returns the "_Feature" FeatureType, where the only thing known is that the contents are Features.
        Specified by:
        getSchema in interface FeatureCollection<FeatureType,​Feature>
        FeatureType describing the "common" schema to all child features of this collection
      • iterator

        public Iterator<Feature> iterator()
      • purge

        public void purge()
      • remove

        public boolean remove​(Object o)
      • removeAll

        public boolean removeAll​(Collection<?> c)
      • removeListener

        public void removeListener​(CollectionListener listener)
                            throws NullPointerException
      • retainAll

        public boolean retainAll​(Collection<?> c)
      • isXmlCollection

        public boolean isXmlCollection()
      • subCollection

        public FeatureCollection<FeatureType,​Feature> 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<FeatureType,​Feature>
        SimpleFeatureCollection identified as subset.
        See Also:
      • getQuery

        public Query getQuery()