Interface IFeatureStoreBase<V extends IFeature,VF extends IFeatureStoreBase.FeatureField,F extends FeatureFilterBase<? super V>>
- Type Parameters:
V
- Feature typeVF
- Feature field enum typeF
- Feature filter type
- All Superinterfaces:
IDataStore<FeatureKey,
,V, VF, F> IResourceStore<FeatureKey,
,V, VF, F> Map<FeatureKey,
V>
- All Known Subinterfaces:
IDeploymentStore
,IFeatureStore
,IFoiStore
,IProcedureStore
,ISystemDescStore
- All Known Implementing Classes:
EmptyDeploymentStore
,EmptyFeatureBaseStore
,EmptyFoiStore
,EmptyProcedureStore
,EmptySystemStore
public interface IFeatureStoreBase<V extends IFeature,VF extends IFeatureStoreBase.FeatureField,F extends FeatureFilterBase<? super V>>
extends IResourceStore<FeatureKey,V,VF,F>
Base interface for data stores containing objects derived from IFeature.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.sensorhub.api.datastore.resource.IResourceStore
IResourceStore.ResourceField
-
Method Summary
Modifier and TypeMethodDescriptionAdd a new feature to the store, generating a new key for it, and also add it as a child of the specified parentdefault FeatureKey
Add a new feature to the store, generating a new key for it.
If a feature with the same UID already exists, a new version of the feature whose validity starts at the specified valid time is created and it shares the same internal ID with the previous version.default boolean
Checks if store contains a feature with the given unique IDdefault boolean
Checks if store contains a feature with the given internal IDdefault V
getCurrentVersion
(String uid) Helper method to retrieve the current version of the feature with the given unique IDdefault V
getCurrentVersion
(BigId internalID) Helper method to retrieve the current version of the feature with the given internal IDdefault Map.Entry<FeatureKey,
V> Helper method to retrieve the entry corresponding to the current version of the feature with the given unique IDdefault Map.Entry<FeatureKey,
V> getCurrentVersionEntry
(BigId internalID) Helper method to retrieve the entry corresponding to the current version of the feature with the given internal IDdefault FeatureKey
Helper method to retrieve the full key corresponding to the current version of the feature with the given unique IDdefault FeatureKey
getCurrentVersionKey
(BigId internalID) Helper method to retrieve the full key corresponding to the current version of the feature with the given internal IDdefault Map.Entry<FeatureKey,
V> getLatestEntry
(Stream<Map.Entry<FeatureKey, V>> featureVersions) default long
Get a feature's parent IDdefault FeatureKey
Helper method to remove all versions of the feature with the given UIDMethods inherited from interface org.sensorhub.api.datastore.IDataStore
backup, commit, containsKey, containsValue, countMatchingEntries, entrySet, getDatastoreName, getNumRecords, isEmpty, isReadOnly, keySet, putAll, removeEntries, restore, select, select, select, selectEntries, selectEntries, selectEntries, selectKeys, size, values
Methods inherited from interface org.sensorhub.api.datastore.resource.IResourceStore
selectAllFilter
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, equals, forEach, get, getOrDefault, hashCode, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll
-
Method Details
-
filterBuilder
FeatureFilterBase.FeatureFilterBaseBuilder<?,?, filterBuilder()F> - Specified by:
filterBuilder
in interfaceIResourceStore<FeatureKey,
V extends IFeature, VF extends IFeatureStoreBase.FeatureField, F extends FeatureFilterBase<? super V>> - Returns:
- A builder for a filter compatible with this datastore
-
add
Add a new feature to the store, generating a new key for it.
If a feature with the same UID already exists, a new version of the feature whose validity starts at the specified valid time is created and it shares the same internal ID with the previous version.- Specified by:
add
in interfaceIResourceStore<FeatureKey,
V extends IFeature, VF extends IFeatureStoreBase.FeatureField, F extends FeatureFilterBase<? super V>> - Parameters:
value
- New feature object- Returns:
- The newly allocated key (internal ID)
- Throws:
DataStoreException
- if a feature with the same UID and valid time already exists
-
add
Add a new feature to the store, generating a new key for it, and also add it as a child of the specified parent- Parameters:
parentID
- Internal ID of parent featurevalue
- New feature object- Returns:
- The newly allocated key (internal ID)
- Throws:
DataStoreException
- if a feature with the same UID and valid time already exists, or if the parent ID is unknown
-
contains
Checks if store contains a feature with the given internal ID- Parameters:
internalID
- The feature internal ID- Returns:
- True if a feature with the given ID exists, false otherwise
-
contains
Checks if store contains a feature with the given unique ID- Parameters:
uid
- The feature unique ID- Returns:
- True if a feature with the given ID exists, false otherwise
-
getParent
Get a feature's parent ID- Parameters:
internalID
- Internal ID of feature- Returns:
- Internal ID of parent feature or null if no feature with the given ID was found or the feature has no parent
-
getCurrentVersionEntry
Helper method to retrieve the entry corresponding to the current version of the feature with the given unique ID- Parameters:
uid
- The feature unique ID- Returns:
- The feature entry or null if no feature with the given ID was found
-
getCurrentVersionEntry
Helper method to retrieve the entry corresponding to the current version of the feature with the given internal ID- Parameters:
internalID
- The feature internal ID- Returns:
- The feature entry or null if no feature with the given ID was found
-
getLatestEntry
-
getCurrentVersionKey
Helper method to retrieve the full key corresponding to the current version of the feature with the given unique ID- Parameters:
uid
- The feature unique ID- Returns:
- The feature key or null if no feature with the given ID was found
-
getCurrentVersionKey
Helper method to retrieve the full key corresponding to the current version of the feature with the given internal ID- Parameters:
internalID
- The feature internal ID- Returns:
- The feature key or null if no feature with the given ID was found
-
getCurrentVersion
Helper method to retrieve the current version of the feature with the given unique ID- Parameters:
uid
- The feature unique ID- Returns:
- The feature representation or null if no feature with the given ID was found
-
getCurrentVersion
Helper method to retrieve the current version of the feature with the given internal ID- Parameters:
internalID
- The feature internal ID- Returns:
- The feature representation or null if no feature with the given ID was found
-
remove
Helper method to remove all versions of the feature with the given UID- Parameters:
uid
- The feature unique ID- Returns:
- The feature key of the current version or null if nothing was removed
-
getNumFeatures
default long getNumFeatures()- Returns:
- Total number of distinct features contained in this data store.
Note that this is different fromIDataStore.getNumRecords()
because the later will count one entry for each version of the same feature while this method will count the feature only once.
-
getFeaturesBbox
Bbox getFeaturesBbox()- Returns:
- Overall bounding rectangle of all features contained in this data store
-