Class ArcGISFeatureTable

    • Method Detail

      • 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

        public List<Field> getEditableAttributeFields()
        Gets a list of fields for which attribute values are editable. Does not include the geometry field; use FeatureTable.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:
        ArcGISFeatureLayerInfo.getEditFieldsInfo()
      • getContingentValuesDefinition

        public ContingentValuesDefinition 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

        public ContingentValuesResult getContingentValues​(ArcGISFeature feature,
                                                          String field)
        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 of ContingentValue objects accessed via ContingentValuesResult.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 by ContingentValuesResult.getContingentValuesAllGroups().

        Parameters:
        feature - the feature
        field - the name of the field for which to get possible values
        Returns:
        a ContingentValuesResult
        Throws:
        IllegalArgumentException - if feature is null
        IllegalArgumentException - if field is null
        Since:
        100.13.0
      • getLayerInfo

        public ArcGISFeatureLayerInfo getLayerInfo()
        Gets the information about the source this dataset originates from.
        Returns:
        ArcGISFeatureLayerInfo object
        Since:
        100.0.0
      • getFeatureTemplates

        public List<FeatureTemplate> getFeatureTemplates()
        Returns the list of feature templates for this table.
        Returns:
        an unmodifiable list of feature templates
        Since:
        100.0.0
      • getFeatureType

        public FeatureType getFeatureType​(String typeName)
        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 using getFeatureTypes() or can be viewed in the service definition for this table.
        Returns:
        the feature type
        Throws:
        IllegalArgumentException - if input is null
        ArcGISRuntimeException - if the input type name is not valid
        Since:
        100.0.0
      • getFeatureTypes

        public List<FeatureType> 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

        public String 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

        public String 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

        public String getTypeIdField()
        Gets the name of the type ID field. This field is used to define the FeatureType of a feature.
        Returns:
        the name of the type ID field.
        Since:
        100.0.0
      • hasAttachments

        public boolean hasAttachments()
        Indicates if this table supports attachments.
        Returns:
        true if the table supports attachments; otherwise false.
        Since:
        100.0.0
      • createFeature

        public ArcGISFeature createFeature​(FeatureTemplate template)
        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

        public ArcGISFeature createFeature​(FeatureTemplate template,
                                           Geometry geometry)
        Creates a feature from the given feature template and the given geometry.
        Parameters:
        template - template to be used
        geometry - geometry of the feature
        Returns:
        a feature
        Throws:
        IllegalArgumentException - if template is null
        Since:
        100.0.0
      • createFeature

        public ArcGISFeature createFeature​(FeatureType type,
                                           Geometry geometry)
        Creates a feature with the given feature type and geometry.
        Parameters:
        type - type to be used
        geometry - geometry of the feature
        Returns:
        a feature
        Throws:
        IllegalArgumentException - if type is null
        Since:
        100.0.0
      • createFeature

        public ArcGISFeature createFeature​(FeatureSubtype featureSubtype)
        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

        public ArcGISFeature createFeature​(FeatureSubtype featureSubtype,
                                           Geometry geometry)
        Creates a feature based on the given feature subtype and with the given geometry.
        Parameters:
        featureSubtype - the FeatureSubtype to be used
        geometry - the geometry of the feature
        Returns:
        an ArcGISFeature
        Throws:
        IllegalArgumentException - if featureSubtype is null
        Since:
        100.3.0
      • getAddedFeaturesAsync

        public ListenableFuture<FeatureQueryResult> getAddedFeaturesAsync()
        Asynchronously gets the features added. Add a done listener to the returned listenable future to know when the result is ready. For ServiceFeatureTables the result is an iterable of features added but not applied, or not successfully applied, using ServiceFeatureTable.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

        public ListenableFuture<Long> getAddedFeaturesCountAsync()
        Asynchronously gets the number of features added. Add a done listener to the returned listenable future to know when the result is ready. For ServiceFeatureTables the result is a count of features added but not applied, or not successfully applied, using ServiceFeatureTable.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

        public Map<String,​Object> getUnknownJson()
        Gets unknown data from the source JSON. Unknown JSON is a dictionary of values that was in the source JSON but was not parsed by the Runtime.
        Returns:
        an unmodifiable map with string keys and object values
        Since:
        100.8.0
      • getUnsupportedJson

        public Map<String,​Object> getUnsupportedJson()
        Gets unsupported data from the source JSON. Unsupported JSON is a dictionary of values that are supported by webmaps, but not exposed through the native Runtime API.
        Returns:
        an unmodifiable map with string keys and object values
        Since:
        100.8.0
      • getUpdatedFeaturesAsync

        public ListenableFuture<FeatureQueryResult> getUpdatedFeaturesAsync()
        Asynchronously gets the features updated. Add a done listener to the returned listenable future to know when the result is ready. For ServiceFeatureTables the result is an iterable of features updated but not applied, or not successfully applied, using ServiceFeatureTable.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

        public ListenableFuture<Long> getUpdatedFeaturesCountAsync()
        Asynchronously gets the number of features updated. Add a done listener to the returned listenable future to know when the result is ready. For ServiceFeatureTables the result is a count of features updated but not applied, or not successfully applied, using ServiceFeatureTable.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

        public ListenableFuture<FeatureQueryResult> getDeletedFeaturesAsync()
        Asynchronously gets the features deleted. Add a done listener to the returned listenable future to know when the result is ready. For ServiceFeatureTables the result is an iterable of features deleted but not applied, or not successfully applied, using ServiceFeatureTable.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

        public ListenableFuture<Long> getDeletedFeaturesCountAsync()
        Asynchronously gets the number of features deleted. Add a done listener to the returned listenable future to know when the result is ready. For ServiceFeatureTables the result is a count of features deleted but not applied, or not successfully applied, using ServiceFeatureTable.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

        public FeatureTemplate getFeatureTemplate​(String templateName)
        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 Feature 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
      • getRelatedTables

        public List<ArcGISFeatureTable> getRelatedTables​(RelationshipInfo relationshipInfo)
        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

        public List<ArcGISFeatureTable> 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 and RelatedFeatureQueryResult.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

        public ListenableFuture<Long> queryRelatedFeatureCountAsync​(ArcGISFeature feature)
        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, and RelatedFeatureQueryResult.getRelatedTable() is used to distinguish between them.
        Parameters:
        feature - feature for which to query related features
        relatedQueryParameters - 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 features
        relatedQueryParameters - 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

        public List<FeatureSubtype> getFeatureSubtypes()
        Gets an unmodifiable list of FeatureSubtype for this table.
        Returns:
        an unmodifiable list of FeatureSubtype for this table
        Since:
        100.3.0
      • getDefaultSubtypeCode

        public Object 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
        If the Main Streets feature subtype is defined as the default, the Integer 2 will be returned as the default code.
        Returns:
        the table's default subtype code or null if no default subtype feature is defined
        Since:
        100.3.0
      • getSubtypeField

        public String 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. You can usually recover from a cardinality violation by unrelating the appropriate features. Also, see ArcGISFeature.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. For GeodatabaseFeatureTable, 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, use GeodatabaseFeatureTable.hasLocalEditsSince(Calendar).

        Returns:
        whether the table has local edits
        Throws:
        ArcGISRuntimeException - if table is not change tracked
        Since:
        100.9.0
      • getLocalEditsCountAsync

        public ListenableFuture<Long> 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