Package org.gvsig.fmap.dal.feature
Interface FeatureStore
- All Superinterfaces:
Cloneable,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.observer.ComplexObservable,org.gvsig.tools.observer.ComplexWeakReferencingObservable,DataFactoryUnit,DataStore,org.gvsig.tools.dispose.Disposable,org.gvsig.tools.dynobject.DynObject,org.gvsig.tools.dynobject.DynObject_v2,Iterable<Feature>,org.gvsig.metadata.Metadata,org.gvsig.tools.observer.Observable,org.gvsig.tools.persistence.Persistent,org.gvsig.tools.util.PropertiesSupport,org.gvsig.tools.service.spi.Services,org.gvsig.tools.util.Size64,org.gvsig.tools.undo.UndoRedoStack,org.gvsig.tools.visitor.Visitable,org.gvsig.tools.observer.WeakReferencingObservable
public interface FeatureStore
extends DataStore, org.gvsig.tools.undo.UndoRedoStack, org.gvsig.tools.lang.Cloneable, Iterable<Feature>, org.gvsig.tools.util.PropertiesSupport, org.gvsig.tools.util.Size64
A FeatureStore is a type of store whose data consists on sets of
Feature(s). Feature(s) from the same FeatureStore can be of
different FeatureType(s) (as in GML format for instance).
FeatureStore allows:
- Obtaining the default
FeatureType. A FeatureStore always has one and only one default FeatureType. - Obtaining the list of
FeatureType(s) defined in the FeatureStore. - Obtaining, filtering and sorting subsets of data (
FeatureSet) throughFeatureQuery, as well as background loading. - Obtaining the total
Envelope(AKA bounding box or extent) of the store. - Support for editing
FeatureType(s). - Obtaining information about contained
Geometrytypes. - Exporting to another store.
- Indexing.
- Selection.
- Locks management.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intIndicates that this store is in append modestatic final intIndicates that this store is in full edit modestatic final intstatic final intIndicates that this store is in query modestatic final intstatic final intEn este modo hace un merge contra la base de datos, si existe lo actualizada y si no lo insertastatic final intFields inherited from interface org.gvsig.fmap.dal.DataStore
CSV_PROVIDER_NAME, DBASE_PROVIDER_NAME, FEATURE_METADATA_DEFINITION_NAME, GEOPACKAGE_PROVIDER_NAME, H2SPATIAL_PROVIDER_NAME, MDB_PROVIDER_NAME, METADATA_CONTAINERNAME, METADATA_CRS, METADATA_ENVELOPE, METADATA_FEATURETYPE, METADATA_PROVIDER, SHAPE_PROVIDER_NAME, SPATIAL_METADATA_DEFINITION_NAME, TIFF_PROVIDER_NAME -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowGeometry(String name, org.gvsig.fmap.geom.Geometry geometry) booleanIndicates whether this store allows writing.voidbeginEditingGroup(String description) Initiates an editing group.booleanvoidCancels all editing since the last edit().booleanstatic booleancancelEditingQuietly(FeatureStore store) booleanReturns true if you can call CommitChanges method.booleancanWriteGeometry(int gvSIGgeometryType) voidSave changes in the provider without leaving the edit mode.voidcopyTo(FeatureStore target) voidcreateCache(String name, org.gvsig.tools.dynobject.DynObject parameters) org.gvsig.expressionevaluator.ExpressionBuilderorg.gvsig.expressionevaluator.ExpressionBuilderReturns a newFeatureQueryassociated to this store.createFeatureQuery(String filter) createFeatureQuery(String filter, String sortBy, boolean asc) Create aFeatureQuerywith the restrictions indicateds.createFeatureQuery(String filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) Create aFeatureQuerywith the restrictions indicateds.createFeatureQuery(org.gvsig.expressionevaluator.Expression filter) createFeatureQuery(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) Create aFeatureQuerywith the restrictions indicateds.createFeatureQuery(org.gvsig.expressionevaluator.Expression filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) Create aFeatureQuerywith the restrictions indicateds.Creates aFeatureSelectioncreateIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName) Creates an index which will be applied to the features of the given type, by using the data of the given attribute.createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName, org.gvsig.tools.observer.Observer observer) Creates an index which will be applied to the features of the given type, by using the data of the given attribute.createIndex(FeatureType featureType, String attributeName, String indexName) Creates an index which will be applied to the features of the given type, by using the data of the given attribute.createIndex(FeatureType featureType, String attributeName, String indexName, org.gvsig.tools.observer.Observer observer) Creates an index which will be applied to the features of the given type, by using the data of the given attribute.Creates aFeatureSelectionCreates a new feature using the default feature type and returns it as anEditableFeaturecreateNewFeature(boolean defaultValues) Creates a new feature of defaultFeatureType.createNewFeature(javax.json.JsonObject defaultValues) createNewFeature(Feature defaultValues) Creates a new feature of defaultFeatureType.createNewFeature(FeatureType type, boolean defaultValues) Creates a new feature of the givenFeatureType.createNewFeature(FeatureType type, Feature defaultValues) Creates a new feature of the givenFeatureTypeand uses the givenFeatureas default values to initialize it.voidvoiddelete(org.gvsig.expressionevaluator.Expression filter) voidDeletes aFeaturefrom the store.
AnyFeatureSetfrom this store that was still in use will be invalidated.voidedit()Enters editing state.voidedit(int mode) Enters editing state specifying the editing mode.voidedit(int mode, int submode) voidFinishes an editing group.voidexport(DataServerExplorer explorer, String provider, NewFeatureStoreParameters params, String name) Exports this store to another store.Returns the firstFeaturethat meets the criteria indicated.Returns the firstFeaturethat meets the criteria indicated.Returns the firstFeaturethat meets the criteria indicated.Returns the firstFeaturethat meets the criteria indicated.findFirst(org.gvsig.expressionevaluator.Expression filter) Returns the firstFeaturethat meets the criteria indicated.Returns the firstFeaturethat meets the criteria indicated.Returns the firstFeaturethat meets the criteria indicated.findFirst(org.gvsig.expressionevaluator.Expression filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) Returns the firstFeaturethat meets the criteria indicated.findFirst(FeatureQuery query) Returns the firstFeaturethat meets the criteria indicated.voidExits editing state.booleanstatic booleanfinishEditingQuietly(FeatureStore store) first()Return the firstFeatureof the store.getCache()Returns this store's defaultFeatureType.org.gvsig.fmap.geom.primitive.EnvelopeReturns this store's total envelope (extent).getFeature(org.gvsig.tools.dynobject.DynObject dynobject) Return the associated feature to the dynobject.getFeatureByReference(FeatureReference reference) Returns the feature given its reference.getFeatureByReference(FeatureReference reference, FeatureType featureType) Returns the feature given its reference and feature type.longReturns featue count of this store.getFeatureReference(String code) Return a paginated list with al Features in the store.getFeatures(String filter) Return a paginated list of Features It is a utility method that callsgetFeatures(FeatureQuery, int)getFeatures(String filter, String sortBy) Return a paginated list of Features.getFeatures(String filter, String sortBy, boolean asc) Return a paginated list of Features.getFeatures(org.gvsig.expressionevaluator.Expression filter) Return a paginated list of Features It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.getFeatures(org.gvsig.expressionevaluator.Expression filter, String sortBy) Return a paginated list of Features It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.getFeatures(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) Return a paginated list of Features It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.getFeatures(FeatureQuery query) Return a paginated list of Features.getFeatures(FeatureQuery query, int pageSize) Return a paginated list of Features filtered by the query.org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(String filter) org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(String filter, String sortBy, boolean asc) org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(FeatureQuery query, int pageSize) Returns the currentFeatureSelection.Returns all available features in the store.getFeatureSet(String filter) Return a subset of features.getFeatureSet(String filter, String sortBy) Return a subset of features.getFeatureSet(String filter, String sortBy, boolean asc) Return a subset of features.getFeatureSet(org.gvsig.expressionevaluator.Expression filter) Return a subset of features.getFeatureSet(org.gvsig.expressionevaluator.Expression filter, String sortBy) Return a subset of features.getFeatureSet(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) Return a subset of features.getFeatureSet(FeatureQuery featureQuery) Returns a subset of features taking into account the properties and restrictions of theFeatureQuery.voidgetFeatureSet(FeatureQuery featureQuery, org.gvsig.tools.observer.Observer observer) Loads a subset of features taking into account the properties and restrictions of the FeatureQuery.voidgetFeatureSet(org.gvsig.tools.observer.Observer observer) Loads all available feature in the store.getFeaturesIterable(Iterator<FeatureReference> references) getFeaturesIterator(Iterator<FeatureReference> references) getFeatureType(String featureTypeId) Returns this store's featureTypeFeatureTypematches with featureTypeId.Returns this store'sFeatureType(s).Returns a FeatureIndexes structure containing all available indexes in the store.getLabel()static StringgetLabel(FeatureStore store) getLocks()Returns the set of locked featuresintgetMode()getOriginalFeature(Feature feature) Returns this store's parameters.longDevuelbe el numero de operaciones pendientes de guardar en una sesion de edicion.intIf thereturns true, it returns the limit of features retrieved from the provider.invalid reference
FeatureStoreProvider#hasRetrievedFeaturesLimit()org.gvsig.crs.projection.lib.ProjectionintReturns this store transformsbooleanReturn if the maximum number of features provided by the provider are limited.voidinsert(EditableFeature feature) Inserts aFeaturein the store.
AnyFeatureSetfrom this store that was still in use will be invalidated.voidinsert(FeatureSet set) Inserts a set ofFeaturein the store.booleanIndicates whether this store is in appending state.booleanIndicates whether this store supports append mode.booleanisBroken()booleanIndicates whether this store is in editing state.booleanisFeatureModified(Feature feature) booleanbooleanbooleanbooleanReturn if the provider knows the real envelope of a layer.booleanIndicates whether this store supports locks.booleanIndicates if the storage is temporary.voidsetSelection(FeatureSet selection) Sets the selection to the passedFeatureSetvoidsetTemporary(Boolean temporary) booleanReturn true when the default feature type of the store support references.voidUpdates Features in the store with the values of the parameters.voidupdate(EditableFeature feature) Updates aFeaturein the store with the changes in theEditableFeature.
AnyFeatureSetfrom this store that was still in use will be invalidated.voidupdate(EditableFeatureType featureType) Updates aFeatureTypein the store with the changes in theEditableFeatureType.
AnyFeatureSetfrom this store that are used will be invalidated.org.gvsig.fmap.geom.SpatialIndexwrapSpatialIndex(org.gvsig.fmap.geom.SpatialIndex index) Methods inherited from interface org.gvsig.tools.lang.Cloneable
cloneMethods inherited from interface org.gvsig.tools.observer.ComplexObservable
beginComplexNotification, disableNotifications, enableNotifications, endComplexNotificationMethods inherited from interface org.gvsig.fmap.dal.DataStore
accept, accept, createQuery, createSelection, getChildren, getDataSet, getDataSet, getDataSet, getDataSet, getExplorer, getFullName, getInterval, getName, getProviderFactory, getProviderName, getResourcesStorage, getSelection, getStoresRepository, getTimes, getTimes, refresh, setSelection, useCacheMethods inherited from interface org.gvsig.tools.dispose.Disposable
disposeMethods inherited from interface org.gvsig.tools.dynobject.DynObject
clear, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValueMethods inherited from interface org.gvsig.tools.dynobject.DynObject_v2
hasDynMethodMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.gvsig.metadata.Metadata
getMetadataChildren, getMetadataID, getMetadataNameMethods inherited from interface org.gvsig.tools.observer.Observable
addObserver, deleteObserver, deleteObserversMethods inherited from interface org.gvsig.tools.persistence.Persistent
loadFromState, saveToStateMethods inherited from interface org.gvsig.tools.util.PropertiesSupport
getProperties, getProperty, setPropertyMethods inherited from interface org.gvsig.tools.util.Size64
size64Methods inherited from interface org.gvsig.tools.undo.UndoRedoStack
canRedo, canUndo, getRedoInfos, getUndoInfos, redo, redo, undo, undo
-
Field Details
-
METADATA_DEFINITION_NAME
- See Also:
-
MODE_UNKNOWN
static final int MODE_UNKNOWN- See Also:
-
MODE_QUERY
static final int MODE_QUERYIndicates that this store is in query mode- See Also:
-
MODE_FULLEDIT
static final int MODE_FULLEDITIndicates that this store is in full edit mode- See Also:
-
MODE_APPEND
static final int MODE_APPENDIndicates that this store is in append mode- See Also:
-
MODE_PASS_THROUGH
static final int MODE_PASS_THROUGH- See Also:
-
SUBMODE_NONE
static final int SUBMODE_NONE- See Also:
-
SUBMODE_MERGE
static final int SUBMODE_MERGEEn este modo hace un merge contra la base de datos, si existe lo actualizada y si no lo inserta- See Also:
-
-
Method Details
-
getLabel
-
allowWrite
boolean allowWrite()Indicates whether this store allows writing.- Returns:
- true if this store can be written, false if not.
-
getDefaultFeatureType
Returns this store's defaultFeatureType.- Returns:
- this store's default
FeatureType. - Throws:
DataException
-
getDefaultFeatureTypeQuietly
FeatureType getDefaultFeatureTypeQuietly() -
getFeatureType
Returns this store's featureTypeFeatureTypematches with featureTypeId.- Parameters:
featureTypeId-- Returns:
- this store's default
FeatureType. - Throws:
DataException
-
getFeatureTypes
Returns this store'sFeatureType(s).- Returns:
- a list with this store's
FeatureType(s). - Throws:
DataException
-
getParameters
DataStoreParameters getParameters()Returns this store's parameters.- Specified by:
getParametersin interfaceDataStore- Returns:
DataStoreParameterscontaining this store's parameters
-
canWriteGeometry
- Parameters:
gvSIGgeometryType-- Returns:
- Throws:
DataException
-
getEnvelope
Returns this store's total envelope (extent).- Returns:
- this store's total envelope (extent) or
nullif store not have geometry information - Throws:
DataException
-
getSRSDefaultGeometry
- Returns:
- Throws:
DataException
-
export
void export(DataServerExplorer explorer, String provider, NewFeatureStoreParameters params, String name) throws DataException Exports this store to another store.- Parameters:
explorer-DataServerExplorertargetprovider-params- New parameters of this store that will be used on the target explorer- Throws:
DataException
-
copyTo
-
createFeatureQuery
Create aFeatureQuerywith the restrictions indicateds. "filter" will be null or a valid filter expression for the store. "sortBy" can be null to use the store's default order. The parameter sortBy can be an attribute name or a comma separated list. Each attribute name can be preceded or followed by "+" or "-" to indicate the order to use to sort by that attribute. If no "+" or "-" is indicated, the "asc" parameter will be used to determine if the order is ascending, "true" or decent, "false".- Parameters:
filter- anStringexpression used to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.asc- use order ascending, true, or descending, false.- Returns:
- a
FeatureQuerywith the restrictions.
-
createFeatureQuery
-
createFeatureQuery
-
createFeatureQuery
FeatureQuery createFeatureQuery(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) Create aFeatureQuerywith the restrictions indicateds. "filter" will be null orExpressionvalid for the store. "sortBy" can be null to use the store's default order. The parameter sortBy can be an attribute name or a comma separated list. Each attribute name can be preceded or followed by "+" or "-" to indicate the order to use to sort by that attribute. If no "+" or "-" is indicated, the "asc" parameter will be used to determine if the order is ascending, "true" or decent, "false".- Parameters:
filter- anStringexpression used to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.asc- use order ascending, true, or descending, false.- Returns:
- a
FeatureQuerywith the restrictions.
-
createFeatureQuery
FeatureQuery createFeatureQuery(org.gvsig.expressionevaluator.Expression filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) Create aFeatureQuerywith the restrictions indicateds. "filter" will be null orExpressionvalid for the store. "sortBy" can be null to use the store's default order. The parameter sortBy can be an attribute name or a comma separated list. Each attribute name can be preceded or followed by "+" or "-" to indicate the order to use to sort by that attribute. If no "+" or "-" is indicated, the "asc" parameter will be used to determine if the order is ascending, "true" or decent, "false".- Parameters:
filter- anStringexpression used to filter the features in the store.sortBy- expression used to order the features in the store.asc- use order ascending, true, or descending, false.- Returns:
- a
FeatureQuerywith the restrictions.
-
createFeatureQuery
FeatureQuery createFeatureQuery(String filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) Create aFeatureQuerywith the restrictions indicateds. "filter" will be null orExpressionvalid for the store. "sortBy" can be null to use the store's default order. The parameter sortBy can be an attribute name or a comma separated list. Each attribute name can be preceded or followed by "+" or "-" to indicate the order to use to sort by that attribute. If no "+" or "-" is indicated, the "asc" parameter will be used to determine if the order is ascending, "true" or decent, "false".- Parameters:
filter- anStringexpression used to filter the features in the store.sortBy- expression used to order the features in the store.asc- use order ascending, true, or descending, false.- Returns:
- a
FeatureQuerywith the restrictions.
-
getFeatureSet
Returns all available features in the store. It is a utility method that callsgetFeatureSet(FeatureQuery)- Returns:
- the
FeatureSet - Throws:
ReadException- if there is any error while reading the featuresDataException
-
getFeatureSet
Return a subset of features. It is a utility method that callsgetFeatureSet(FeatureQuery)- Parameters:
filter- anStringexpression used to filter the features in the store.- Returns:
- the
FeatureSet - Throws:
ReadException- if there is any error while reading the featuresDataException
-
getFeatureSet
Return a subset of features. It is a utility method that callsgetFeatureSet(FeatureQuery)The sort order used is ascending.- Parameters:
filter- anStringexpression used to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.- Returns:
- the
FeatureSet - Throws:
ReadException- if there is any error while reading the featuresDataException
-
getFeatureSet
Return a subset of features. It is a utility method that callsgetFeatureSet(FeatureQuery)- Parameters:
filter- anStringexpression used to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.asc- use order ascending, true, or descending, false.- Returns:
- the
FeatureSet - Throws:
ReadException- if there is any error while reading the featuresDataException
-
getFeatureSet
Return a subset of features. It is a utility method that callsgetFeatureSet(FeatureQuery)- Parameters:
filter- anExpressionused to filter the features in the store.- Returns:
- the
FeatureSet - Throws:
DataException
-
getFeatureSet
FeatureSet getFeatureSet(org.gvsig.expressionevaluator.Expression filter, String sortBy) throws DataException Return a subset of features. It is a utility method that callsgetFeatureSet(FeatureQuery)The sort order used is ascending.- Parameters:
filter- anExpressionused to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.- Returns:
- the
FeatureSet - Throws:
ReadException- if there is any error while reading the featuresDataException
-
getFeatureSet
FeatureSet getFeatureSet(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) throws DataException Return a subset of features. It is a utility method that callsgetFeatureSet(FeatureQuery)- Parameters:
filter- anExpressionused to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.asc- use order ascending, true, or descending, false.- Returns:
- the
FeatureSet - Throws:
DataException
-
getFeatureSet
Returns a subset of features taking into account the properties and restrictions of theFeatureQuery. IfFeatureQueryis null, return al features in the store.NOTE: if you use this method to get a
FeatureSet, you must get sure it is disposed (@seeDisposable.dispose()) in any case, even if an error occurs while getting the data. It is recommended to use theacceptmethods instead, which handle everything for you. Take into account the accept methods may use a fast iterator to get the features.- Parameters:
featureQuery- defines the characteristics of the features to return.- Returns:
- the
FeatureSet - Throws:
ReadException- if there is any error while reading the features.DataException- See Also:
-
getFeatureSet
void getFeatureSet(FeatureQuery featureQuery, org.gvsig.tools.observer.Observer observer) throws DataException Loads a subset of features taking into account the properties and restrictions of the FeatureQuery. When feature loading is finished call the Observer passing theFeatureSetloaded.- Parameters:
featureQuery- defines the characteristics of the features to return.observer- to be notified when loading is finished.- Throws:
DataException- if there is any error while loading the features
-
getFeatureSet
Loads all available feature in the store. The loading of Features is performed by calling the Observer, once each loaded Feature.- Parameters:
observer- to be notified of each loaded Feature- Throws:
DataException- if there is any error while loading the features
-
getFeatures
Return a paginated list of Features filtered by the query. If the query is null, return all features in the store sorteds by default order. The return value implementsListandUnmodifiableBasicList64to support large list of features. The returned list of Features is paginated, and the page size used is "pageSize". If the page size is less than or equal to 0, the default page size of 100 will be used.- Parameters:
query- to filter and sort the returned feature listpageSize- the page size of the list- Returns:
- the
List/UnmodifiableBasicList64of features
-
getFeatures
Return a paginated list of Features. It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.- Parameters:
query- to filter and sort the returned feature list- Returns:
- the
List/UnmodifiableBasicList64of features
-
getFeatures
Return a paginated list with al Features in the store. It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.- Returns:
- the
List/UnmodifiableBasicList64of features
-
getFeatures
Return a paginated list of Features It is a utility method that callsgetFeatures(FeatureQuery, int)- Parameters:
filter- used to filter the features in the store.- Returns:
- the List of Features
-
getFeatures
Return a paginated list of Features. It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.- Parameters:
filter- used to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.- Returns:
- the
List/UnmodifiableBasicList64of features
-
getFeatures
Return a paginated list of Features. It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size. -
getFeatures
Return a paginated list of Features It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.- Parameters:
filter- anExpressionused to filter the features in the store.- Returns:
- the List of Features
-
getFeatures
Return a paginated list of Features It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.- Parameters:
filter- anExpressionused to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.- Returns:
- the
List/UnmodifiableBasicList64of features
-
getFeatures
List<Feature> getFeatures(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) Return a paginated list of Features It is a utility method that callsgetFeatures(FeatureQuery, int)using the default page size.- Parameters:
filter- anExpressionused to filter the features in the store.sortBy- Attribute names separated by commas used to sort the list to return.asc- use order ascending, true, or descending, false.- Returns:
- the
List/UnmodifiableBasicList64of features
-
getFeatures64
org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64() -
getFeatures64
-
getFeatures64
-
getFeatures64
org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(FeatureQuery query, int pageSize) -
first
Return the firstFeatureof the store.- Returns:
- the first
Featureor null if the store is empty. - Throws:
DataException
-
findFirst
Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
filter-Stringexpression used to filter the features.- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
findFirst
Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
filter-Stringexpression used to filter the features.sortBy- Attribute names separated by commas used to sort the list to return.- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
findFirst
Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
filter-Stringexpression used to filter the features.sortBy- Attribute names separated by commas used to sort the list to return.asc- use order ascending, true, or descending, false.- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
findFirst
Feature findFirst(String filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) throws DataException Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
filter-Stringexpression used to filter the features.sortBy- Expressionasc- use order ascending, true, or descending, false.- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
findFirst
Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
filter-Stringexpression used to filter the features.- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
findFirst
Feature findFirst(org.gvsig.expressionevaluator.Expression filter, String sortBy) throws DataException Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
filter-Stringexpression used to filter the features.sortBy- Attribute names separated by commas used to sort the list to return.- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
findFirst
Feature findFirst(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) throws DataException Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
filter-Stringexpression used to filter the features.sortBy- Attribute names separated by commas used to sort the list to return.asc- use order ascending, true, or descending, false.- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
findFirst
Feature findFirst(org.gvsig.expressionevaluator.Expression filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) throws DataException Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
filter-Stringexpression used to filter the features.sortBy- expression used to sort featuresasc- use order ascending, true, or descending, false.- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
findFirst
Returns the firstFeaturethat meets the criteria indicated. It is a utility method that callsfindFirst(FeatureQuery).- Parameters:
query- to filter and sort the returned feature list- Returns:
- the first
Featureor null if the filter don't return any feature. - Throws:
DataException
-
getFeatureByReference
Returns the feature given its reference.- Parameters:
reference- a unique FeatureReference- Returns:
- Throws:
DataException
-
getFeatureByReference
Feature getFeatureByReference(FeatureReference reference, FeatureType featureType) throws DataException Returns the feature given its reference and feature type.- Parameters:
reference- a unique FeatureReferencefeatureType- FeatureType to which the requested Feature belongs- Returns:
- The Feature
- Throws:
DataException
-
edit
Enters editing state.- Throws:
DataException
-
edit
Enters editing state specifying the editing mode.- Parameters:
mode-- Throws:
DataException
-
edit
- Throws:
DataException
-
getSubmode
int getSubmode() -
getMode
int getMode() -
cancelEditing
Cancels all editing since the last edit().- Throws:
DataException
-
cancelEditingQuietly
boolean cancelEditingQuietly() -
cancelEditingQuietly
-
finishEditing
Exits editing state.- Throws:
DataException
-
finishEditingQuietly
boolean finishEditingQuietly() -
finishEditingQuietly
-
commitChanges
Save changes in the provider without leaving the edit mode. Do not call observers to communicate a change of ediding mode. The operation's history is eliminated to prevent inconsistencies in the data.- Throws:
DataException
-
canCommitChanges
Returns true if you can call CommitChanges method. If not in editing or changes have been made in the structure return false.- Returns:
- true if can call commitChanges
- Throws:
DataException
-
isEditing
boolean isEditing()Indicates whether this store is in editing state.- Returns:
- true if this store is in editing state, false if not.
-
isAppending
boolean isAppending()Indicates whether this store is in appending state. In this state the new features are automatically inserted at the end of theFeatureSet.- Returns:
- true if this store is in appending state.
-
update
Updates aFeatureTypein the store with the changes in theEditableFeatureType.
AnyFeatureSetfrom this store that are used will be invalidated.- Parameters:
featureType- anEditableFeatureTypewith the changes.- Throws:
DataException
-
update
Updates aFeaturein the store with the changes in theEditableFeature.
AnyFeatureSetfrom this store that was still in use will be invalidated. You can override this usingFeatureSet.update(EditableFeature).- Parameters:
feature- the feature to be updated- Throws:
DataException
-
update
Updates Features in the store with the values of the parameters. Examples: update("field1",value1,"field2",value2); update("field1",value1,"field2",value2,filter); filter can be aExpressionor a String- Parameters:
parameters-- Throws:
DataException
-
delete
Deletes aFeaturefrom the store.
AnyFeatureSetfrom this store that was still in use will be invalidated. You can override this usingIterator.remove()fromFeatureSet.- Parameters:
feature- The feature to be deleted.- Throws:
DataException
-
delete
-
delete
void delete(org.gvsig.expressionevaluator.Expression filter) -
insert
Inserts aFeaturein the store.
AnyFeatureSetfrom this store that was still in use will be invalidated. You can override this usingFeatureSet.insert(EditableFeature).- Parameters:
feature- The feature to be inserted- Throws:
DataException
-
insert
Inserts a set ofFeaturein the store. The attributes of the feature are copied from the features of the set by name, forcing the conversion of types if necessary. AnyFeatureSetfrom this store that was still in use will be invalidated.- Parameters:
set- , set with the source features.- Throws:
DataException
-
createNewFeature
Creates a new feature using the default feature type and returns it as anEditableFeature- Returns:
- a new feature in editable state
- Throws:
DataException
-
createNewFeature
Creates a new feature of the givenFeatureTypeand uses the givenFeatureas default values to initialize it.- Parameters:
type- the new feature's feature typedefaultValues- a feature whose values are used as default values for the new feature.- Returns:
- the new feature.
- Throws:
DataException
-
createNewFeature
Creates a new feature of the givenFeatureType. The flag defaultValues is used to indicate whether the new feature should be initialized with default values or not.- Parameters:
type- the new feature's feature typedefaultValues- if true the new feature is initialized with each attribute's default value.- Returns:
- the new feature
- Throws:
DataException
-
createNewFeature
Creates a new feature of defaultFeatureType. The flag defaultValues is used to indicate whether the new feature should be initialized with default values or not.- Parameters:
defaultValues- if true the new feature is initialized with each attribute's default value.- Returns:
- the new feature
- Throws:
DataException
-
createNewFeature
Creates a new feature of defaultFeatureType. The new feature should be initialized with the values of the feature passed as parameter. Values are inicialiced by name from the feature specified. Error in value assignement are ignoreds.- Parameters:
defaultValues- the values to initialize the new feature.- Returns:
- the new feature
- Throws:
DataException
-
createNewFeature
- Throws:
DataException
-
isAppendModeSupported
boolean isAppendModeSupported()Indicates whether this store supports append mode.- Returns:
- true if this store supports append mode.
-
beginEditingGroup
Initiates an editing group. This is typically used to group series of store editing operations.- Parameters:
description- Description of the editing group.- Throws:
NeedEditingModeException
-
endEditingGroup
Finishes an editing group.- Throws:
NeedEditingModeException
-
createIndex
FeatureIndex createIndex(FeatureType featureType, String attributeName, String indexName) throws DataException Creates an index which will be applied to the features of the given type, by using the data of the given attribute.- Parameters:
featureType- The FeatureType to which the indexed attribute belongs.attributeName- The name of the attributed to be indexedindexName- The index name- Returns:
- the resulting
FeatureIndex - Throws:
FeatureIndexException- if there is an error creating the indexDataException
-
createIndex
FeatureIndex createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName) throws DataException Creates an index which will be applied to the features of the given type, by using the data of the given attribute.- Parameters:
indexTypeName- the type of the index to be created. That name is related to one of the registered index providersfeatureType- The FeatureType to which the indexed attribute belongs.attributeName- The name of the attributed to be indexedindexName- The index name- Returns:
- the resulting
FeatureIndex - Throws:
FeatureIndexException- if there is an error creating the indexDataException
-
createIndex
FeatureIndex createIndex(FeatureType featureType, String attributeName, String indexName, org.gvsig.tools.observer.Observer observer) throws DataException Creates an index which will be applied to the features of the given type, by using the data of the given attribute. This method will return without waiting for the index to be filled, as that will be performed in background. An optionalObserverparameter is provided to be notified (FeatureStoreNotification.INDEX_FILLING_SUCCESS) when the index has finished filling with data and is available to be used.- Parameters:
featureType- The FeatureType to which the indexed attribute belongs.attributeName- The name of the attributed to be indexedindexName- The index nameobserver- to notify to when the created index has finished filling with data and is available to be used. The observer will receive then aFeatureStoreNotification.INDEX_FILLING_SUCCESSnotification, with the index object if it has finished successfully, or aFeatureStoreNotification.INDEX_FILLING_ERRORnotification with the exception object if there has been any error in the process. Optional.- Returns:
- the resulting
FeatureIndex - Throws:
FeatureIndexException- if there is an error creating the indexDataException- See Also:
-
createIndex
FeatureIndex createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName, org.gvsig.tools.observer.Observer observer) throws DataException Creates an index which will be applied to the features of the given type, by using the data of the given attribute. This method will return without waiting for the index to be filled, as that will be performed in background. An optionalObserverparameter is provided to be notified (FeatureStoreNotification.INDEX_FILLING_SUCCESS) when the index has finished filling with data and is available to be used.- Parameters:
indexTypeName- the type of the index to be created. That name is related to one of the registered index providersfeatureType- The FeatureType to which the indexed attribute belongs.attributeName- The name of the attributed to be indexedindexName- The index nameobserver- to notify to when the created index has finished filling with data and is available to be used. The observer will receive then aFeatureStoreNotification.INDEX_FILLING_SUCCESSnotification, with the index object if it has finished successfully, or aFeatureStoreNotification.INDEX_FILLING_ERRORnotification with the exception object if there has been any error in the process. Optional.- Returns:
- the resulting
FeatureIndex - Throws:
FeatureIndexException- if there is an error creating the indexDataException- See Also:
-
getIndexes
FeatureIndexes getIndexes()Returns a FeatureIndexes structure containing all available indexes in the store.- Returns:
-
setSelection
Sets the selection to the passedFeatureSet- Parameters:
selection- AFeatureSetwith the requested selection- Throws:
DataException
-
createFeatureSelection
Creates aFeatureSelection- Returns:
- a
FeatureSelection - Throws:
DataException
-
createLargeFeatureSelection
- Throws:
DataException
-
createMemoryFeatureSelection
Creates aFeatureSelection- Returns:
- a
FeatureSelection - Throws:
DataException
-
getFeatureSelection
Returns the currentFeatureSelection. Create a empty selection if not exits. Manage of the selection can be slow on some data sources. Use with care. In data sources that do not support position access to records, it may be slow to retrieve items from the selection. In some data sources it may be necessary to access to this to retrieve each item in the selection.- Returns:
- current
FeatureSelection. - Throws:
DataException
-
getFeatureSelectionQuietly
FeatureSelection getFeatureSelectionQuietly() -
isLocksSupported
boolean isLocksSupported()Indicates whether this store supports locks.- Returns:
- true if this store supports locks, false if not.
-
getLocks
Returns the set of locked features- Returns:
- set of locked features
- Throws:
DataException
-
getTransforms
FeatureStoreTransforms getTransforms()Returns this store transforms- Returns:
- this store transforms
-
createFeatureQuery
FeatureQuery createFeatureQuery()Returns a newFeatureQueryassociated to this store.- Returns:
- a new
FeatureQueryassociated to this store.
-
getFeatureCount
Returns featue count of this store.- Returns:
- Throws:
DataException
-
isKnownEnvelope
boolean isKnownEnvelope()Return if the provider knows the real envelope of a layer. If not, themethod doesn't return the full envelope.invalid reference
FeatureStoreProvider#getEnvelope()- Returns:
- true if it knows the real envelope.
-
hasRetrievedFeaturesLimit
boolean hasRetrievedFeaturesLimit()Return if the maximum number of features provided by the provider are limited.- Returns:
- true if there is a limit of features.
-
getRetrievedFeaturesLimit
int getRetrievedFeaturesLimit()If thereturns true, it returns the limit of features retrieved from the provider.invalid reference
FeatureStoreProvider#hasRetrievedFeaturesLimit()- Returns:
- The limit of the retrieved features.
-
getFeature
Return the associated feature to the dynobject. If the dynobject isn't associated to a feature of this store, return null.- Parameters:
dynobject-- Returns:
-
createExpressionBuilder
org.gvsig.expressionevaluator.ExpressionBuilder createExpressionBuilder() -
createExpression
org.gvsig.expressionevaluator.ExpressionBuilder createExpression()- Returns:
-
createCache
- Throws:
DataException
-
getCache
FeatureCache getCache() -
isBroken
boolean isBroken() -
getBreakingsCause
Throwable getBreakingsCause() -
isTemporary
boolean isTemporary()Indicates if the storage is temporary. There is no guarantee that a temporary store can be recovered from its parameters. In general these will not be persistent.- Returns:
- true if the store is temporary, otherwise false.
-
setTemporary
-
wrapSpatialIndex
org.gvsig.fmap.geom.SpatialIndex wrapSpatialIndex(org.gvsig.fmap.geom.SpatialIndex index) - Parameters:
index-- Returns:
-
getFeatureReference
-
getPendingChangesCount
long getPendingChangesCount()Devuelbe el numero de operaciones pendientes de guardar en una sesion de edicion. Es un valor orientativo. Las operaciones pendientes son la suma de operaciones de borrado, insercion o modificacion de las features en una sesion de edicion. Retorna 0 si no esta en edicion.- Returns:
- numero de operaciones pendientes.
-
getSampleFeature
Feature getSampleFeature() -
supportReferences
boolean supportReferences()Return true when the default feature type of the store support references.- Returns:
- true when support references.
-
getOriginalFeature
-
getOriginalFeature
-
isFeatureModified
-
isFeatureModified
-
getEditingSession
String getEditingSession() -
getEditedFeatures
List<FeatureReference> getEditedFeatures() -
getEditedFeaturesNotValidated
List<FeatureReference> getEditedFeaturesNotValidated() -
isFeatureSelectionEmpty
boolean isFeatureSelectionEmpty() -
isFeatureSelectionAvailable
boolean isFeatureSelectionAvailable() -
getFeaturesIterator
-
getFeaturesIterable
-
canBeEdited
boolean canBeEdited() -
getLabel
String getLabel() -
setNotificationsFilter
Predicate<FeatureStoreNotification> setNotificationsFilter(Predicate<FeatureStoreNotification> filter) -
allowGeometry
-