Package org.apache.sis.internal.storage
Class MemoryFeatureSet
java.lang.Object
org.apache.sis.storage.AbstractResource
org.apache.sis.storage.AbstractFeatureSet
org.apache.sis.internal.storage.MemoryFeatureSet
- All Implemented Interfaces:
DataSet
,FeatureSet
,Resource
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection<AbstractFeature>
The features specified at construction time, potentially as a modifiable collection.private final DefaultFeatureType
The type specified at construction time and returned bygetType()
.Fields inherited from class org.apache.sis.storage.AbstractResource
listeners
-
Constructor Summary
ConstructorsConstructorDescriptionMemoryFeatureSet
(StoreListeners parent, DefaultFeatureType type, Collection<AbstractFeature> features) Creates a new set of features stored in memory. -
Method Summary
Methods inherited from class org.apache.sis.storage.AbstractFeatureSet
createMetadata, getIdentifier
Methods inherited from class org.apache.sis.storage.AbstractResource
addListener, clearCache, 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
-
type
The type specified at construction time and returned bygetType()
. -
features
The features specified at construction time, potentially as a modifiable collection. For all features in this collection,AbstractFeature.getType()
shall betype
.
-
-
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 thatAbstractFeature.getType() == type
for all elements in the given collection (this is not verified).- Parameters:
parent
- listeners of the parent resource, ornull
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
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
Returns the number of features in this set.- Overrides:
getFeatureCount
in classAbstractFeatureSet
- Returns:
- the number of features.
-
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.
-