Class WritableStore

All Implemented Interfaces:
AutoCloseable, ResourceOnFileSystem, StoreResource, DataSet, FeatureSet, Resource, WritableFeatureSet, Localized

public final class WritableStore extends Store implements WritableFeatureSet
A GPX store capable to write GPX file.
Since:
1.3
Version:
1.3
Author:
Johann Sorel (Geomatys), Martin Desruisseaux (Geomatys)
  • Constructor Details

  • Method Details

    • updateType

      public void updateType(DefaultFeatureType newType) throws DataStoreException
      Verifies the type of feature instances in this feature set. This method does nothing if the specified type is equal to Store.getType(), or throws IllegalFeatureTypeException otherwise.
      Specified by:
      updateType in interface WritableFeatureSet
      Parameters:
      newType - new feature type definition (not null).
      Throws:
      DataStoreException - if the given type is not compatible with the types supported by the store.
    • add

      public void add(Iterator<? extends AbstractFeature> features) throws DataStoreException
      Appends new feature instances in this FeatureSet. Any feature already present in this
      invalid reference
      FeatureSet
      will remain unmodified.
      Specified by:
      add in interface WritableFeatureSet
      Parameters:
      features - feature instances to append in this FeatureSet.
      Throws:
      DataStoreException - if the feature stream cannot be obtained or updated.
    • removeIf

      public boolean removeIf(Predicate<? super AbstractFeature> filter) throws DataStoreException
      Removes all feature instances from this FeatureSet which matches the given predicate.
      Specified by:
      removeIf in interface WritableFeatureSet
      Parameters:
      filter - a predicate which returns true for feature instances to be removed.
      Returns:
      true if any elements were removed.
      Throws:
      DataStoreException - if the feature stream cannot be obtained or updated.
    • replaceIf

      public void replaceIf(Predicate<? super AbstractFeature> filter, UnaryOperator<AbstractFeature> replacement) throws DataStoreException
      Updates all feature instances from this FeatureSet which match the given predicate. If the given operator returns null, then the filtered feature is removed.
      Specified by:
      replaceIf in interface WritableFeatureSet
      Parameters:
      filter - a predicate which returns true for feature instances to be updated.
      replacement - operation called for each matching Feature instance. May return null.
      Throws:
      DataStoreException - if the feature stream cannot be obtained or updated.
    • write

      @Deprecated public void write(org.opengis.metadata.Metadata metadata, Stream<? extends AbstractFeature> features) throws DataStoreException
      Deprecated.
      To be replaced by add(Iterator), after we resolved how to specify metadata.
      Replaces the content of this GPX file by the given metadata and features.
      Parameters:
      metadata - the metadata to write, or null if none.
      features - the features to write, or null if none.
      Throws:
      ConcurrentReadException - if the features stream was provided by this data store.
      DataStoreException - if an error occurred while writing the data.
      See Also: