Class MemoryFeatureSet

All Implemented Interfaces:
DataSet, FeatureSet, Resource

public class MemoryFeatureSet extends AbstractFeatureSet
Set of features stored in memory. Features are specified at construction time. Metadata can be specified by overriding #createMetadata(MetadataBuilder).
Since:
1.0
Version:
1.2
  • Field Details

  • Constructor Details

    • MemoryFeatureSet

      public MemoryFeatureSet(StoreListeners parent, DefaultFeatureType type, Collection<AbstractFeature> features)
      Creates a new set of features stored in memory. It is caller responsibility to ensure that AbstractFeature.getType() == type for all elements in the given collection (this is not verified).
      Parameters:
      parent - listeners of the parent resource, or null if none.
      type - the type of all features in the given collection.
      features - collection of stored features. This collection will not be copied.
  • Method Details

    • getType

      public DefaultFeatureType getType()
      Returns the type common to all feature instances in this set.
      Returns:
      a description of properties that are common to all features in this dataset.
    • getFeatureCount

      public OptionalLong getFeatureCount()
      Returns the number of features in this set.
      Overrides:
      getFeatureCount in class AbstractFeatureSet
      Returns:
      the number of features.
    • features

      public Stream<AbstractFeature> features(boolean parallel)
      Returns a stream of all features contained in this dataset.
      Parameters:
      parallel - true for a parallel stream (if supported), or false for a sequential stream.
      Returns:
      all features contained in this dataset.