Class FeatureCollectionWrapper

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Feature feature)
      Adds a feature to this collection.
      void addAll​(Collection features)
      Adds multiple features to this collection.
      void checkNotWrappingSameClass()
      Throws an AssertionFailedException if this FeatureCollectionWrapper wraps (directly or indirectly) another FeatureCollectionWrapper having the same class (or descendant class thereof).
      void clear()
      Removes all features from this collection.
      org.locationtech.jts.geom.Envelope getEnvelope()
      Returns the bounds of this collection.
      List getFeatures()
      Returns an unmodifiable List of the features in this collection
      FeatureSchema getFeatureSchema()
      Returns information about this FeatureCollection
      FeatureCollection getUltimateWrappee()
      Returns the non-wrapper FeatureCollection wrapped by this wrapper and possibly by other wrappers in-between.
      FeatureCollection getWrappee()
      Returns the FeatureCollection that this wrapper delegates to (possibly another FeatureCollectionWrapper).
      boolean hasWrapper​(Class c)
      Returns whether this FeatureCollectionWrapper (or a FeatureCollectionWrapper that it wraps, directly or indirectly) is an instance of the given class (or one of its descendants).
      boolean isEmpty()
      Returns whether this collection has no features.
      Iterator iterator()
      Returns an Iterator over the features
      List query​(org.locationtech.jts.geom.Envelope envelope)
      A quick search for features, using an envelope comparison.
      Collection remove​(org.locationtech.jts.geom.Envelope env)
      Removes the features which intersect the given envelope
      void remove​(Feature feature)
      Removes a feature from this collection.
      void removeAll​(Collection features)
      Removes multiple features from this collection.
      int size()
      Returns the number of features in this collection.
    • Constructor Detail

      • FeatureCollectionWrapper

        public FeatureCollectionWrapper​(FeatureCollection fc)
        Constructs a FeatureCollectionWrapper that delegates to the given FeatureCollection.
    • Method Detail

      • getUltimateWrappee

        public FeatureCollection getUltimateWrappee()
        Returns the non-wrapper FeatureCollection wrapped by this wrapper and possibly by other wrappers in-between. Intended to get at the "real" FeatureCollection underneath several layers of FeatureCollectionWrappers.
        See Also:
        getWrappee()
      • checkNotWrappingSameClass

        public void checkNotWrappingSameClass()
        Throws an AssertionFailedException if this FeatureCollectionWrapper wraps (directly or indirectly) another FeatureCollectionWrapper having the same class (or descendant class thereof). A consistency check that is useful for some FeatureCollectionWrapper implementations.
      • remove

        public Collection remove​(org.locationtech.jts.geom.Envelope env)
        Description copied from interface: FeatureCollection
        Removes the features which intersect the given envelope
        Specified by:
        remove in interface FeatureCollection
        Returns:
        the removed features
      • hasWrapper

        public boolean hasWrapper​(Class c)
        Returns whether this FeatureCollectionWrapper (or a FeatureCollectionWrapper that it wraps, directly or indirectly) is an instance of the given class (or one of its descendants).
      • getWrappee

        public FeatureCollection getWrappee()
        Returns the FeatureCollection that this wrapper delegates to (possibly another FeatureCollectionWrapper).
        See Also:
        getUltimateWrappee()
      • getEnvelope

        public org.locationtech.jts.geom.Envelope getEnvelope()
        Description copied from interface: FeatureCollection
        Returns the bounds of this collection.
        Specified by:
        getEnvelope in interface FeatureCollection
        Returns:
        the smallest Envelope enclosing all the Features in this collection
      • size

        public int size()
        Description copied from interface: FeatureCollection
        Returns the number of features in this collection.
        Specified by:
        size in interface FeatureCollection
        Returns:
        the number of features in this collection
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: FeatureCollection
        Returns whether this collection has no features.
        Specified by:
        isEmpty in interface FeatureCollection
        Returns:
        whether or not the size of this collection is 0
      • getFeatures

        public List getFeatures()
        Description copied from interface: FeatureCollection
        Returns an unmodifiable List of the features in this collection
        Specified by:
        getFeatures in interface FeatureCollection
        Returns:
        a read-only view of all the features
      • query

        public List query​(org.locationtech.jts.geom.Envelope envelope)
        Description copied from interface: FeatureCollection
        A quick search for features, using an envelope comparison.
        Specified by:
        query in interface FeatureCollection
        Parameters:
        envelope - the envelope to query against
        Returns:
        features whose envelopes intersect the given envelope
      • add

        public void add​(Feature feature)
        Description copied from interface: FeatureCollection
        Adds a feature to this collection.
        Specified by:
        add in interface FeatureCollection
        Parameters:
        feature - a Feature to add to the end of this collection
      • remove

        public void remove​(Feature feature)
        Description copied from interface: FeatureCollection
        Removes a feature from this collection.
        Specified by:
        remove in interface FeatureCollection
        Parameters:
        feature - a Feature to remove from this collection
      • addAll

        public void addAll​(Collection features)
        Description copied from interface: FeatureCollection
        Adds multiple features to this collection. To be preferred over #add for adding multiple features, because in some systems (like the JUMP Workbench) fewer events will be fired.
        Specified by:
        addAll in interface FeatureCollection
      • removeAll

        public void removeAll​(Collection features)
        Description copied from interface: FeatureCollection
        Removes multiple features from this collection. To be preferred over #remove for removing multiple features, because in some systems (like the JUMP Workbench) fewer events will be fired.
        Specified by:
        removeAll in interface FeatureCollection