- All Implemented Interfaces:
Loadable
,PopupSource
- Direct Known Subclasses:
GeodatabaseFeatureTable
,ServiceFeatureTable
This is the base class for the ArcGIS specific feature tables GeodatabaseFeatureTable
and
ServiceFeatureTable
. You can create instances of these subclasses using their constructors.
If FeatureTable.hasGeometry()
is true, you can display the features in an
ArcGISMap
or ArcGISScene
. To do
this create a FeatureLayer
from the feature table and add it to the map or
scene's collection of operational layers (GeoModel.getOperationalLayers()
).
The ArcGISFeatureTable can also contain features that do not have a geometry
(FeatureTable.hasGeometry()
is false).
ArcGISFeatureTable provides methods for querying related features (for example,
ArcGISFeatureTable.queryRelatedFeaturesAsync(ArcGISFeature)), and methods to create new features based on a
FeatureSubtype
or a FeatureTemplate
.
Features from an ArcGISFeatureTable will be instances of the ArcGISFeature
class, these have additional ArcGIS
specific capabilities such as attachments. ArcGISFeatures implement loadable, see the ArcGISFeature
class for full
details.
- Since:
- 100.0.0
- See Also:
-
Property Summary
Properties inherited from class com.esri.arcgisruntime.data.FeatureTable
loadError, loadStatus
-
Method Summary
Modifier and TypeMethodDescriptioncreateFeature
(FeatureSubtype featureSubtype) Creates a feature based on the given feature subtype.createFeature
(FeatureSubtype featureSubtype, Geometry geometry) Creates a feature based on the given feature subtype and with the given geometry.createFeature
(FeatureTemplate template) Creates a feature from the given feature template.createFeature
(FeatureTemplate template, Geometry geometry) Creates a feature from the given feature template and the given geometry.createFeature
(FeatureType type) Creates a feature from the given feature type; using the firstFeatureTemplate
contained in the given type.createFeature
(FeatureType type, Geometry geometry) Creates a feature with the given feature type and geometry.Asynchronously gets the features added.Asynchronously gets the number of features added.getContingentValues
(ArcGISFeature feature, String field) Returns possible values for the specified field, in the context of defined contingencies.Gets the table's contingent values definition.Gets default subtype code for this table.Asynchronously gets the features deleted.Asynchronously gets the number of features deleted.Gets a list of fields for which attribute values are editable.Gets an unmodifiable list of FeatureSubtype for this table.getFeatureTemplate
(String templateName) Gets the feature template for the given name.Returns the list of feature templates for this table.getFeatureType
(String typeName) Gets the feature type.Gets all the feature types.Gets the name of the global ID field.Gets the information about the source this dataset originates from.Retrieves all the features that were added, updated or deleted since the last sync.Returns the number of features that were added, updated or deleted since the last sync.Gets the name of the object ID field.Gets an unmodifiable list of tables related to this table.getRelatedTables
(RelationshipInfo relationshipInfo) Gets an unmodifiable list containing any instances of the table related to this table by the given RelationshipInfo.long
Returns the layer ID in the feature service that this table was created from.Gets the name of this table's subtype field.Gets the name of the type ID field.Gets unknown data from the source JSON.Gets unsupported data from the source JSON.Asynchronously gets the features updated.Asynchronously gets the number of features updated.Gets the username of the feature table.boolean
True if the features in this table have attachments, false otherwise.boolean
Gets whether the feature table has local edits.boolean
Indicates whether the Feature table is using advanced symbology.Performs an asynchronous query that returns the number of features related to the supplied feature.queryRelatedFeatureCountAsync
(ArcGISFeature feature, RelatedQueryParameters relatedQueryParameters) Performs an asynchronous query that returns the number of features related to the supplied feature based on the parameters.queryRelatedFeaturesAsync
(ArcGISFeature feature) Asynchronously queries for features related to the given ArcGISFeature.queryRelatedFeaturesAsync
(ArcGISFeature feature, RelatedQueryParameters relatedQueryParameters) Asynchronously queries for features related to the given ArcGISFeature and using the given RelatedQueryParameters.void
setUseAdvancedSymbology
(boolean useAdvancedSymbology) Sets whether the Feature table will use the advanced symbology.Returns an unmodifiable list of contingency constraint violations based on the input feature.Checks for relationship violations that may exist with the given feature.Methods inherited from class com.esri.arcgisruntime.data.FeatureTable
addDoneLoadingListener, addFeatureAsync, addFeaturesAsync, addLoadStatusChangedListener, canAdd, cancelLoad, canDelete, canEditGeometry, canUpdate, createFeature, createFeature, deleteFeatureAsync, deleteFeaturesAsync, getDisplayName, getExtent, getField, getFields, getGeometryType, getLayer, getLoadError, getLoadStatus, getPopupDefinition, getSpatialReference, getTableName, getTotalFeatureCount, hasGeometry, hasM, hasZ, isEditable, isPopupEnabled, loadAsync, loadErrorProperty, loadStatusProperty, queryExtentAsync, queryFeatureCountAsync, queryFeaturesAsync, queryStatisticsAsync, removeDoneLoadingListener, removeLoadStatusChangedListener, retryLoadAsync, setDisplayName, setPopupDefinition, setPopupEnabled, updateFeatureAsync, updateFeaturesAsync
-
Method Details
-
getServiceLayerId
public long getServiceLayerId()Returns the layer ID in the feature service that this table was created from.- Returns:
- the ID
- Since:
- 100.0.0
-
getEditableAttributeFields
Gets a list of fields for which attribute values are editable. Does not include the geometry field; useFeatureTable.canEditGeometry()
to determine if the geometry of features is editable. Also does not include managed editor tracking fields which are edited by the internals of this API.- Returns:
- an unmodifiable list of the editable attribute fields, null if there are none
- Since:
- 100.0.0
- See Also:
-
getContingentValuesDefinition
Gets the table's contingent values definition.The contingent values definition must be loaded after the table has loaded. If the list of field groups is empty after loading, then no contingent values are defined for this table.
- Returns:
- the table's contingent values definition
- Since:
- 100.13.0
-
getContingentValues
Returns possible values for the specified field, in the context of defined contingencies.This method iterates over all the field groups that the input field participates in. For each, it looks at the input feature's field values for the other fields participating in that field group. Contingencies that are satisfied by the other fields are identified, and their values for the input field are aggregated. These are returned in a
ContingentValuesResult
, which contains a map of field group names to an list ofContingentValue
objects accessed viaContingentValuesResult.getContingentValuesByFieldGroup()
, specifying possible values for the input field that will satisfy a contingency in that field group. If the feature participates in multiple field groups and there are values that will satisfy all groups, they will be returned byContingentValuesResult.getContingentValuesAllGroups()
.- Parameters:
feature
- the featurefield
- the name of the field for which to get possible values- Returns:
- a
ContingentValuesResult
- Throws:
IllegalArgumentException
- if feature is nullIllegalArgumentException
- if field is null- Since:
- 100.13.0
-
getLayerInfo
Gets the information about the source this dataset originates from.Explore the editing capabilities of this feature table with
ArcGISFeatureLayerInfo.getCapabilities()
or the editor tracked fields withArcGISFeatureLayerInfo.getEditFieldsInfo()
.- Returns:
- ArcGISFeatureLayerInfo object
- Since:
- 100.0.0
-
getFeatureTemplates
Returns the list of feature templates for this table.- Returns:
- an unmodifiable list of feature templates
- Since:
- 100.0.0
-
getFeatureType
Gets the feature type. Feature types represent a class of features (also known as sub-types) that can exist in this table.- Parameters:
typeName
- the name of the feature type. Names can be found by usinggetFeatureTypes()
or can be viewed in the service definition for this table.- Returns:
- the feature type
- Throws:
IllegalArgumentException
- if input is nullArcGISRuntimeException
- if the input type name is not valid- Since:
- 100.0.0
-
getFeatureTypes
Gets all the feature types. Feature types represent a class of features (also known as sub-types) that can exist in this table.- Returns:
- an unmodifiable list of all feature types in the table
- Since:
- 100.0.0
-
getGlobalIdField
Gets the name of the global ID field. Global IDs uniquely identify features; you will never find the same Global ID in any other table or database.- Returns:
- the name of the global ID field
- Since:
- 100.0.0
-
getObjectIdField
Gets the name of the object ID field. Object IDs uniquely identify features within a table; you may find the same object ID in another table.- Returns:
- the name of the object ID field.
- Since:
- 100.0.0
-
getTypeIdField
Gets the name of the type ID field. This field is used to define theFeatureType
of a feature.- Returns:
- the name of the type ID field.
- Since:
- 100.0.0
-
validateContingencyConstraints
Returns an unmodifiable list of contingency constraint violations based on the input feature. An empty list indicates that all contingencies associated with the feature are valid.- Parameters:
feature
- the feature- Returns:
- an list of
ContingencyConstraintViolation
- Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.13.0
-
hasAttachments
public boolean hasAttachments()True if the features in this table have attachments, false otherwise.- Returns:
- true if the features in this table have attachments, false otherwise
- Since:
- 100.0.0
-
createFeature
Creates a feature from the given feature template.- Parameters:
template
- template to be used- Returns:
- a feature
- Throws:
IllegalArgumentException
- if template is null- Since:
- 100.0.0
-
createFeature
Creates a feature from the given feature template and the given geometry.- Parameters:
template
- template to be usedgeometry
- geometry of the feature- Returns:
- a feature
- Throws:
IllegalArgumentException
- if template is null- Since:
- 100.0.0
-
createFeature
Creates a feature from the given feature type; using the firstFeatureTemplate
contained in the given type.- Parameters:
type
- type to be used- Returns:
- a feature
- Throws:
IllegalArgumentException
- if type is null- Since:
- 100.0.0
-
createFeature
Creates a feature with the given feature type and geometry.- Parameters:
type
- type to be usedgeometry
- geometry of the feature- Returns:
- a feature
- Throws:
IllegalArgumentException
- if type is null- Since:
- 100.0.0
-
createFeature
Creates a feature based on the given feature subtype.- Parameters:
featureSubtype
- the FeatureSubtype- Returns:
- an ArcGISFeature
- Throws:
IllegalArgumentException
- if featureSubtype is null- Since:
- 100.3.0
-
createFeature
Creates a feature based on the given feature subtype and with the given geometry.- Parameters:
featureSubtype
- the FeatureSubtype to be usedgeometry
- the geometry of the feature- Returns:
- an ArcGISFeature
- Throws:
IllegalArgumentException
- if featureSubtype is null- Since:
- 100.3.0
-
getAddedFeaturesAsync
Asynchronously gets the features added. Add a done listener to the returned listenable future to know when the result is ready. ForServiceFeatureTable
s the result is an iterable of features added but not applied, or not successfully applied, usingServiceFeatureTable.applyEditsAsync()
.For mobile geodatabases created by ArcGIS Pro, this method returns no features because there is no concept of syncing.
- Returns:
- The task object representing the asynchronous retrieval of features added since last sync. It is a listenable
future that will contain the
FeatureQueryResult
. - Since:
- 100.0.0
-
getAddedFeaturesCountAsync
Asynchronously gets the number of features added. Add a done listener to the returned listenable future to know when the result is ready. ForServiceFeatureTable
s the result is a count of features added but not applied, or not successfully applied, usingServiceFeatureTable.applyEditsAsync()
.For mobile geodatabases created by ArcGIS Pro, this method returns 0 because there is no concept of syncing.
- Returns:
- The task object representing the asynchronous retrieval of features added since last sync. It is a listenable future that will contain the number of features added.
- Since:
- 100.0.0
-
getUnknownJson
Gets unknown data from the source JSON.Unknown JSON is a Map of values not defined in the ArcGIS specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted. The ArcGIS specification may be for a web map, web scene, REST API, and so on.
- Returns:
- an unmodifiable map with string keys and object values of unknown data from the source JSON
- Since:
- 100.8.0
-
getUnsupportedJson
Gets unsupported data from the source JSON.Unsupported JSON is a Map of values defined in the ArcGIS specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted. The ArcGIS specification may be from a web map, web scene, REST API, and so on.
- Returns:
- an unmodifiable map with string keys and object values of unsupported data from the source JSON
- Since:
- 100.8.0
-
getUpdatedFeaturesAsync
Asynchronously gets the features updated. Add a done listener to the returned listenable future to know when the result is ready. ForServiceFeatureTable
s the result is an iterable of features updated but not applied, or not successfully applied, usingServiceFeatureTable.applyEditsAsync()
.For mobile geodatabases created by ArcGIS Pro, this method returns no features because there is no concept of syncing.
- Returns:
- The task object representing the asynchronous retrieval of features updated since
last sync. It is a listenable future that will contain the
FeatureQueryResult
. - Since:
- 100.0.0
-
getUpdatedFeaturesCountAsync
Asynchronously gets the number of features updated. Add a done listener to the returned listenable future to know when the result is ready. ForServiceFeatureTable
s the result is a count of features updated but not applied, or not successfully applied, usingServiceFeatureTable.applyEditsAsync()
.For mobile geodatabases created by ArcGIS Pro, this method returns 0 because there is no concept of syncing.
- Returns:
- The task object representing the asynchronous retrieval of features updated since last sync. It is a listenable future that will contain the number of features updated.
- Since:
- 100.0.0
-
getDeletedFeaturesAsync
Asynchronously gets the features deleted. Add a done listener to the returned listenable future to know when the result is ready. ForServiceFeatureTable
s the result is an iterable of features deleted but not applied, or not successfully applied, usingServiceFeatureTable.applyEditsAsync()
.For mobile geodatabases created by ArcGIS Pro, this method returns no features because there is no concept of syncing.
- Returns:
- The task object representing the aasynchronous retrieval of features deleted since the last sync. A
listenable future that will contain the
FeatureQueryResult
. - Since:
- 100.0.0
-
getDeletedFeaturesCountAsync
Asynchronously gets the number of features deleted. Add a done listener to the returned listenable future to know when the result is ready. ForServiceFeatureTable
s the result is a count of features deleted but not applied, or not successfully applied, usingServiceFeatureTable.applyEditsAsync()
.For mobile geodatabases created by ArcGIS Pro, this method returns 0 because there is no concept of syncing.
- Returns:
- The task object representing the asynchronous retrieval of features deleted since the last sync. A listenable future that will contain the number of features deleted.
- Since:
- 100.0.0
-
getFeatureTemplate
Gets the feature template for the given name.- Parameters:
templateName
- the name of the feature template- Returns:
- the feature template
- Throws:
IllegalArgumentException
- if input is null- Since:
- 100.0.0
-
isUseAdvancedSymbology
public boolean isUseAdvancedSymbology()Indicates whether the Feature table is using advanced symbology.- Returns:
- true if the table is using advanced symbology, false otherwise
- Since:
- 100.0.0
-
setUseAdvancedSymbology
public void setUseAdvancedSymbology(boolean useAdvancedSymbology) Sets whether the Feature table will use the advanced symbology. This method should be called before loading the Feature table.- Parameters:
useAdvancedSymbology
- true to use advanced symbology, false otherwise- Since:
- 100.0.0
-
getUsername
Gets the username of the feature table.The username is used for ownership-based access control (OBAC) and editor tracking purposes.
- Returns:
- the username of the feature table
- Since:
- 200.0.0
-
getRelatedTables
Gets an unmodifiable list containing any instances of the table related to this table by the given RelationshipInfo. This is because more than one instance of the same table can be added to the map and all of these instances must be returned. Only returns tables that have been added to the same ArcGISMap as this table.- Parameters:
relationshipInfo
- the RelationshipInfo defining the relationship- Returns:
- an unmodifiable list of tables
- Throws:
IllegalArgumentException
- if relationshipInfo is null- Since:
- 100.1.0
-
getRelatedTables
Gets an unmodifiable list of tables related to this table. Only returns tables that have been added to the same ArcGISMap as this table.- Returns:
- an unmodifiable list of tables
- Since:
- 100.1.0
-
queryRelatedFeaturesAsync
public ListenableFuture<List<RelatedFeatureQueryResult>> queryRelatedFeaturesAsync(ArcGISFeature feature) Asynchronously queries for features related to the given ArcGISFeature. Only returns results from tables that have been added to the same ArcGISMap as this table. As there can be more than one instance of the same table or layer on the map with different scale level visibility, definition expression, and so on, a list of results are returned. In such cases, results from all instances are returned, one per related table containing features related to the queried feature andRelatedFeatureQueryResult.getRelatedTable()
is used to distinguish between them.- Parameters:
feature
- feature for which to query related features- Returns:
- a ListenableFuture representing the query result and indicating if the result
java.util.concurrent.Future.isDone()
; also allows cancellation. - Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.1.0
-
queryRelatedFeatureCountAsync
Performs an asynchronous query that returns the number of features related to the supplied feature.The query result can be obtained by calling get() on the
ListenableFuture
, which may also throw an exception if the operation fails.- Parameters:
feature
- the feature which should be queried for the number of related features- Returns:
- A task that represents the asynchronous query of related feature count. It is a ListenableFuture for tracking when the asynchronous operation is done and getting a Long value.
- Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.2.0
-
queryRelatedFeaturesAsync
public ListenableFuture<List<RelatedFeatureQueryResult>> queryRelatedFeaturesAsync(ArcGISFeature feature, RelatedQueryParameters relatedQueryParameters) Asynchronously queries for features related to the given ArcGISFeature and using the given RelatedQueryParameters. Only returns results from tables that have been added to the same ArcGISMap as this table. As there can be more than one instance of the same table or layer on the map with different scale level visibility, definition expression, and so on, a list of results are returned. In such cases, results from all instances are returned, one per related table containing features related to the queried feature, andRelatedFeatureQueryResult.getRelatedTable()
is used to distinguish between them.- Parameters:
feature
- feature for which to query related featuresrelatedQueryParameters
- the related query parameters- Returns:
- a ListenableFuture representing the query result and indicating if the result
java.util.concurrent.Future.isDone()
; also allows cancellation. - Throws:
IllegalArgumentException
- if feature or relatedQueryParameters are null- Since:
- 100.1.0
-
queryRelatedFeatureCountAsync
public ListenableFuture<Long> queryRelatedFeatureCountAsync(ArcGISFeature feature, RelatedQueryParameters relatedQueryParameters) Performs an asynchronous query that returns the number of features related to the supplied feature based on the parameters.The query result can be obtained by calling get() on the
ListenableFuture
, which may also throw an exception if the operation fails.- Parameters:
feature
- feature for which to query related featuresrelatedQueryParameters
- the related query parameters- Returns:
- A task that represents the asynchronous query of related feature count. It is a ListenableFuture for tracking when the asynchronous operation is done and getting a Long value.
- Throws:
IllegalArgumentException
- if feature or relatedQueryParameters is null- Since:
- 100.2.0
-
getFeatureSubtypes
Gets an unmodifiable list of FeatureSubtype for this table.- Returns:
- an unmodifiable list of FeatureSubtype for this table
- Since:
- 100.3.0
-
getDefaultSubtypeCode
Gets default subtype code for this table.Subtypes are implemented by coded values, which are integers. Those integer values each represent a feature in the subtype. For example, the following codes in a subtype named RoadClass could represent valid classes in a feature class for streets:
- 0 - Local Streets
- 1 - Secondary Streets
- 2 - Main Streets
- Returns:
- the table's default subtype code or null if no default subtype feature is defined
- Since:
- 100.3.0
-
getSubtypeField
Gets the name of this table's subtype field.- Returns:
- the name of this table's subtype field or an empty string if the feature subtype is not defined
- Since:
- 100.3.0
-
validateRelationshipConstraintsAsync
public ListenableFuture<RelationshipConstraintViolation> validateRelationshipConstraintsAsync(ArcGISFeature feature) Checks for relationship violations that may exist with the given feature. The following are considered violations:- In a composite relationship, adding an orphan feature to the destination table without relating it to an origin feature.
-
Cardinality Violations:
- In 1:1 relationships, if an origin feature is already related to a destination feature, relating another feature to either of them.
- In 1:n relationships, relating a destination feature to more than one origin feature.
To recover from an orphaned destination feature violation, simply relate it to a valid origin feature, using
ArcGISFeature.relateFeature(ArcGISFeature)
You can usually recover from a cardinality violation by removing the relationship between the appropriate features, usingArcGISFeature.unrelateFeature(ArcGISFeature)
.Note that edit operations do not error when there are constraint violations. This allows you to recover from violations in a back office operation after applying edits or syncing, if you choose to do so. See ArcGIS Desktop Validate Features process here.
Note: This method makes network calls to query for the related features if they are not present locally.- Parameters:
feature
- the feature to be checked- Returns:
- A task that represents the asynchronous validation of relationship constraints operation.It is a
ListenableFuture representing the validation result and indicating if the result
java.util.concurrent.Future.isDone()
; also allows cancellation. - Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.1.0
-
hasLocalEdits
public boolean hasLocalEdits()Gets whether the feature table has local edits.For
ServiceFeatureTable
, local edits are edits that have not yet been applied to the feature service. ForGeodatabaseFeatureTable
, local edits are edits that have been made since the last acknowledged upload. For mobile geodatabases created by ArcGIS Pro, this method returns false because there is no concept of uploading or applying edits. For mobile geodatabases, useGeodatabaseFeatureTable.hasLocalEditsSince(Calendar)
.- Returns:
- true if the table has local edits, false otherwise
- Throws:
ArcGISRuntimeException
- if table is not change tracked- Since:
- 100.9.0
-
getLocalEditsAsync
Retrieves all the features that were added, updated or deleted since the last sync.Returns a result object containing a feature edit iterator. For mobile geodatabase created by ArcGIS Pro, the iterator in the result object is empty because there is no concept of syncing.
Note that edits inside a transaction (between calls to
Geodatabase.beginTransaction()
and eitherGeodatabase.commitTransaction()
orGeodatabase.rollbackTransaction()
) share a commonLocalFeatureEdit.getEditDateTime()
and may not be returned in a consistent order.- Returns:
- a
LocalFeatureEditsResult
containing an Iterator ofLocalFeatureEdit
objects - Since:
- 100.12.0
-
getLocalEditsCountAsync
Returns the number of features that were added, updated or deleted since the last sync.For mobile geodatabases created by ArcGIS Pro, this method returns a count of 0 because there is no concept of syncing.
- Returns:
- the number of features edited since the last sync
- Since:
- 100.12.0
-