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()
      • 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
      • 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().
        Returns:
        A listenable future that will contain the number of features added
        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().
        Returns:
        A listenable future that will contain the number of features updated
        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().
        Returns:
        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 -
        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 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
        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 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 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