Package org.apache.sis.storage.aggregate
Class ConcatenatedFeatureSet
Object
AbstractResource
AbstractFeatureSet
ConcatenatedFeatureSet
- All Implemented Interfaces:
- DataSet,- FeatureSet,- Resource
Exposes a sequence of 
FeatureSets as a single one.
 The concatenation is built from an array or collection of input feature sets,
 copied verbatim in iteration order and without removal of duplicated elements.
 All input feature sets must share a common type, or at least a common super-type.
 The feature type of this concatenated set will be the
 most specific type found among all input feature sets.
 Identification
There is no identifier since this feature set is a computation result.Multi-threading
Concatenated feature set is immutable and thread-safe if all input feature sets are immutable and thread-safe.- Since:
- 1.0
Defined in the sis-storage module
- 
Field SummaryFields inherited from class AbstractResourcelisteners
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedConcatenatedFeatureSet(StoreListeners parent, FeatureSet[] sources) Creates a new feature set as a concatenation of the sequence of features given by thesources.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidClears any cache in this resource, forcing the data to be recomputed when needed again.static FeatureSetcreate(Collection<? extends FeatureSet> sources) Creates a new feature set as a concatenation of the sequence of features given by thesources.static FeatureSetcreate(FeatureSet... sources) Creates a new feature set as a concatenation of the sequence of features given by thesources.protected MetadataInvoked in a synchronized block the first time thatgetMetadata()is invoked.features(boolean parallel) Returns a stream of all features contained in this concatenated dataset.Returns the union of the envelopes in all aggregated feature sets.Returns an estimation of the number of features in this set, or an empty value if unknown.getType()Returns the most specific feature type common to all feature sets given to the constructor.Requests a subset of features and/or feature properties from this resource.Methods inherited from class AbstractFeatureSetgetIdentifierMethods inherited from class AbstractResourceaddListener, getMetadata, getSynchronizationLock, removeListenerMethods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResourceaddListener, getMetadata, removeListener
- 
Constructor Details- 
ConcatenatedFeatureSetprotected ConcatenatedFeatureSet(StoreListeners parent, FeatureSet[] sources) throws DataStoreException Creates a new feature set as a concatenation of the sequence of features given by thesources. This constructor does not verify that the givensourcesarray contains at least two elements; this verification must be done by the caller. This constructor retains the givensourcesarray by direct reference; clone, if desired, shall be done by the caller.- Parameters:
- parent- listeners of the parent resource, or- nullif none.
- sources- the sequence of feature sets to expose in a single set. Must neither be null, empty nor contain a single element only.
- Throws:
- DataStoreException- if given feature sets does not share any common type.
 
 
- 
- 
Method Details- 
createCreates a new feature set as a concatenation of the sequence of features given by thesources. The given array shall be non-empty. If the array contains only 1 element, that element is returned.- Parameters:
- sources- the sequence of feature sets to expose in a single set.
- Returns:
- the concatenation of given feature set.
- Throws:
- DataStoreException- if given feature sets does not share any common type.
 
- 
createCreates a new feature set as a concatenation of the sequence of features given by thesources. The given collection shall be non-empty. If the collection contains only 1 element, that element is returned.- Parameters:
- sources- the sequence of feature sets to expose in a single set.
- Returns:
- the concatenation of given feature set.
- Throws:
- DataStoreException- if given feature sets does not share any common type.
 
- 
getTypeReturns the most specific feature type common to all feature sets given to the constructor.- Returns:
- the common type of all features returned by this set.
 
- 
getFeatureCountReturns an estimation of the number of features in this set, or an empty value if unknown. This is the sum of the estimations provided by all source sets, or empty if at least one source could not provide an estimation.- Overrides:
- getFeatureCountin class- AbstractFeatureSet
- Returns:
- estimation of the number of features.
 
- 
featuresReturns a stream of all features contained in this concatenated dataset. If theparallelargument isfalse, then datasets are traversed in the order they were specified at construction time. If theparallelargument istrue, then datasets are traversed in no determinist order. If an error occurred while reading the feature instances from a source, then the error is wrapped in aBackingStoreException.- Parameters:
- parallel-- truefor a parallel stream, or- falsefor a sequential stream.
- Returns:
- all features contained in this dataset.
 
- 
subsetRequests a subset of features and/or feature properties from this resource.- Parameters:
- query- definition of feature and feature properties filtering applied at reading time.
- Returns:
- resulting subset of features (never null).
- Throws:
- DataStoreException- if an error occurred while processing the query.
- See Also:
 
- 
getEnvelopeReturns the union of the envelopes in all aggregated feature sets. This method tries to find a CRS common to all feature sets. If no common CRS can be found, then the envelope is absent.Implementation note: this method is final because overriding it would invalidate the unwrapping of otherAggregatedFeatureSetinstances. If we wish to allow overrides in a future version, we would need to revisitgetEnvelopes(List)first.- Specified by:
- getEnvelopein interface- DataSet
- Overrides:
- getEnvelopein class- AbstractResource
- Returns:
- union of envelopes from all dependencies.
- Throws:
- DataStoreException- if an error occurred while computing the envelope.
 
- 
createMetadataInvoked in a synchronized block the first time thatgetMetadata()is invoked. The default implementation adds the information documented in the parent class, then adds the dependencies as lineages.- Overrides:
- createMetadatain class- AbstractFeatureSet
- Returns:
- the newly created metadata, or nullif unknown.
- Throws:
- DataStoreException- if an error occurred while reading metadata from the data stores.
 
- 
clearCacheprotected void clearCache()Clears any cache in this resource, forcing the data to be recomputed when needed again. This method should be invoked if the data in underlying data store changed.- Overrides:
- clearCachein class- AbstractResource
 
 
-