Package org.apache.sis.storage
Class FeatureSubset
java.lang.Object
org.apache.sis.storage.AbstractResource
org.apache.sis.storage.AbstractFeatureSet
org.apache.sis.storage.FeatureSubset
- All Implemented Interfaces:
DataSet
,FeatureSet
,Resource
The result of
FeatureQuery.execute(FeatureSet)
executed using Java Stream
methods.
Queries executed by this class do not benefit from accelerations provided for example by databases.
This class should be used only as a fallback when the query cannot be executed natively by
FeatureSet.subset(Query)
.- Since:
- 1.0
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FeatureQuery
The query for filtering the source set of features.private DefaultFeatureType
The type of features in this set.private final FeatureSet
The set of feature instances to filter, sort or process.Fields inherited from class org.apache.sis.storage.AbstractResource
listeners
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureSubset
(FeatureSet source, FeatureQuery query) Creates a new set of features by filtering the given set using the given query. -
Method Summary
Methods inherited from class org.apache.sis.storage.AbstractFeatureSet
getFeatureCount, getIdentifier
Methods inherited from class org.apache.sis.storage.AbstractResource
addListener, clearCache, createExceptionMessage, getEnvelope, getMetadata, getSynchronizationLock, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.sis.storage.DataSet
getEnvelope
Methods inherited from interface org.apache.sis.storage.FeatureSet
subset
Methods inherited from interface org.apache.sis.storage.Resource
addListener, getMetadata, removeListener
-
Field Details
-
source
The set of feature instances to filter, sort or process. -
query
The query for filtering the source set of features. -
resultType
The type of features in this set. May or may not be the same assource
. This is computed when first needed.
-
-
Constructor Details
-
FeatureSubset
FeatureSubset(FeatureSet source, FeatureQuery query) Creates a new set of features by filtering the given set using the given query. This given query is stored as-is (it is not cloned neither optimized).
-
-
Method Details
-
createMetadata
Creates metadata about this subset. It includes information about the complete feature set.- Overrides:
createMetadata
in classAbstractFeatureSet
- Returns:
- the newly created metadata, or
null
if unknown. - Throws:
DataStoreException
- if an error occurred while reading metadata from this resource.
-
getType
Returns a description of properties that are common to all features in this dataset.- Returns:
- description of common properties (never
null
). - Throws:
DataStoreException
- if an error occurred while reading definitions from the underlying data store.
-
features
Returns a stream of all features contained in this dataset.- Parameters:
parallel
-true
for a parallel stream (if supported), orfalse
for a sequential stream.- Returns:
- all features contained in this dataset.
- Throws:
DataStoreException
- if an error occurred while creating the stream.
-