com.esri.arcgis.carto
Interface IElementCollection

All Superinterfaces:
Serializable
All Known Implementing Classes:
ElementCollection

public interface IElementCollection
extends Serializable

Provides access to members that control the Graphics element collection.

Superseded By

IElementCollection2

Description

The IElementCollection interface provides a tool for managing a collection of Graphic Elements. It includes functionality to handle feature-linked elements, such as annotation.

Remarks

Once the collection is created, elements can be added using the Add method and removed using the Remove method. Specific elements can be queried from the collection using the QueryItem method, while the entire collection can be iterated using the For Each...Next statement. The collection can be cleared of all elements using the Clear method. At anytime, the count of elements present in the collection is known using Count property.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


Method Summary
 void add(IElement element, int linkedFeatureID)
          Adds an element to the collection.
 void clear()
          Removes all the elements in the collection.
 int getCount()
          Number of elements in the collection.
 void queryItem(int index, IElement[] element, int[] linkedFeatureID)
          Element at the given index.
 void remove(IElement element)
          Remove an element from the collection.
 

Method Detail

add

void add(IElement element,
         int linkedFeatureID)
         throws IOException,
                AutomationException
Adds an element to the collection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
element - A reference to a com.esri.arcgis.carto.IElement (in)
linkedFeatureID - The linkedFeatureID (in, optional, pass -1 if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCount

int getCount()
             throws IOException,
                    AutomationException
Number of elements in the collection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryItem

void queryItem(int index,
               IElement[] element,
               int[] linkedFeatureID)
               throws IOException,
                      AutomationException
Element at the given index.

Description

Passes out the element at the specified index. Will also pass out the feature ID for feature-linked elements if the FeatureID parameter is used.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
index - The index (in)
element - A reference to a com.esri.arcgis.carto.IElement (out: use single element array)
linkedFeatureID - The linkedFeatureID (out: use single element array, optional, pass single element of null if not required)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clear

void clear()
           throws IOException,
                  AutomationException
Removes all the elements in the collection.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

remove

void remove(IElement element)
            throws IOException,
                   AutomationException
Remove an element from the collection.

Remarks

Removes specific elements from ElementCollection. Query method and TypeOf Statement can be used to determine a particular element before removing it.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
element - A reference to a com.esri.arcgis.carto.IElement (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.