com.esri.arcgis.geodatabase
Interface ISelectionSet

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ISelectionSet2
All Known Implementing Classes:
ISelectionSet2Proxy, ISelectionSetProxy, RelQueryTableSelectionSet, SelectionSet, TMSSelectSet

public interface ISelectionSet
extends java.io.Serializable

Provides access to members that manage a set of selected table rows or features.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Remarks

A SelectionSet is used to reference a set of rows or features. This can be used to retrieve, process and select rows or features. 

A SelectionSet can be obtained from IFeatureClass::Select or ITable::Select.

If you want to obtain a selection set on a FeatureLayer it is good practice to cast the layer into an ITable then use the ITable::Select method. The table that you will obtain this way will mirror the content of the layer even if it has a definition query or a join. For an example of this see the ISelectionSet or ISelectFeaturesOperation examples.

The IFeatureSelection interface contains a SelectionSet property which can be used to access or set the selection on a feature layer. If trying to set the selection with this property you must make sure that the content of the selection set is compatible with the features currently in the layer. It is usually simpler to use IFeatureSelection::SelectFeatures instead.

Selection sets are also used in a number of other interfaces dealing with the selection: ITableSort, IFeatureSelection, ITableSelection, ISelectFeaturesOperation, to name a few.


Method Summary
 void add(int oID)
          Adds an object id to the selection set.
 void addList(int count, int[] oIDList)
          Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeoDatabaseHelper.addList(com.esri.arcgis.geodatabase.ISelectionSet, int[]).
 void combine(ISelectionSet otherSet, int setOp, ISelectionSet[] resultSet)
          Combines this selection set with another selection set using the specified set operation.
 int getCount()
          The number of oids in the selection set.
 IName getFullName()
          The full name of the selection set.
 IEnumIDs getIDs()
          Enumerates the object ids in the selection set.
 ITable getTarget()
          The Table or FeatureClass over which the selection set is defined.
 void makePermanent()
          Makes the SelectionSet permanent.
 void refresh()
          Refreshes the state of a snapshot selection.
 void removeList(int count, int[] oIDList)
          Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeoDatabaseHelper.removeList(com.esri.arcgis.geodatabase.ISelectionSet, int[]).
 void search(IQueryFilter pQueryFilter, boolean recycling, ICursor[] ppCursor)
          Returns a cursor that can be used to retrieve the objects specified by a query over this selection set.
 ISelectionSet select(IQueryFilter queryFilter, int selType, int selOption, IWorkspace selectionContainer)
          Returns a new selection That contains the object ids selected by a query over this selection set.
 

Method Detail

getFullName

public IName getFullName()
                  throws java.io.IOException,
                         AutomationException
The full name of the selection set.

Supported Platforms

Windows, Solaris, Linux

Remarks

The FullName property has not been implemented.

Returns:
A reference to a com.esri.arcgis.system.IName
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTarget

public ITable getTarget()
                 throws java.io.IOException,
                        AutomationException
The Table or FeatureClass over which the selection set is defined.

Supported Platforms

Windows, Solaris, Linux

Remarks

The Target property returns a reference to the Table or Feature Class from which the Selection Set was constructed.

Returns:
A reference to a com.esri.arcgis.geodatabase.ITable
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

makePermanent

public void makePermanent()
                   throws java.io.IOException,
                          AutomationException
Makes the SelectionSet permanent. By default SelectionSets are deleted when released.

Supported Platforms

Windows, Solaris, Linux

Remarks

Not implemented

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

getCount

public int getCount()
             throws java.io.IOException,
                    AutomationException
The number of oids in the selection set.

Supported Platforms

Windows, Solaris, Linux

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

add

public void add(int oID)
         throws java.io.IOException,
                AutomationException
Adds an object id to the selection set.

Supported Platforms

Windows, Solaris, Linux

Parameters:
oID - The oID (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addList

public void addList(int count,
                    int[] oIDList)
             throws java.io.IOException,
                    AutomationException
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeoDatabaseHelper.addList(com.esri.arcgis.geodatabase.ISelectionSet, int[]).

Adds a list of object id's to the selection set.

Supported Platforms

Windows, Solaris, Linux

Parameters:
count - The count (in)
oIDList - The oIDList (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

combine

public void combine(ISelectionSet otherSet,
                    int setOp,
                    ISelectionSet[] resultSet)
             throws java.io.IOException,
                    AutomationException
Combines this selection set with another selection set using the specified set operation.

Supported Platforms

Windows, Solaris, Linux

Remarks

Used to combine to SelectionSets.  The resultSet must be a third SelectionSet and not any of the ones that are combined: If you want to combine A and B and put the result in A. You must combine A and B with the result in C then set A equal to C.

Parameters:
otherSet - A reference to a com.esri.arcgis.geodatabase.ISelectionSet (in)
setOp - A com.esri.arcgis.geodatabase.esriSetOperation constant (in)
resultSet - A reference to a com.esri.arcgis.geodatabase.ISelectionSet (out: use single element array)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

search

public void search(IQueryFilter pQueryFilter,
                   boolean recycling,
                   ICursor[] ppCursor)
            throws java.io.IOException,
                   AutomationException
Returns a cursor that can be used to retrieve the objects specified by a query over this selection set.

Supported Platforms

Windows, Solaris, Linux

Remarks

Search will return an ICursor with all of the rows that satisfy the attribute query as specified by an IQueryFilter object. If Nothing is given as the IQueryFilter, then the cursor will contain all of the rows of the table.

The Recycling parameter controls row object allocation behavior.

Recycling cursors rehydrate a single feature/row object on each fetch and can be used to optimize read-only access, for example, when drawing. It is illegal to maintain a reference on a feature/row object returned by a recycling cursor across multiple calls to NextRow on the cursor. Feature/Row objects returned by a recycling cursor should not be modified. Non-recycling cursors return a separate object on each fetch.

The features/rows returned by a non-recycling cursor may be modified and stored with polymorphic behavior. The geodatabase guarantees "unique instance semantics" on non-recycling feature/row objects fetched during an edit session. If the object to be retrieved by a call to search has already been instantiated and is being referenced by the calling application, then a reference to the existing row object is returned.

Parameters:
pQueryFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
recycling - The recycling (in)
ppCursor - A reference to a com.esri.arcgis.geodatabase.ICursor (out: use single element array)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

select

public ISelectionSet select(IQueryFilter queryFilter,
                            int selType,
                            int selOption,
                            IWorkspace selectionContainer)
                     throws java.io.IOException,
                            AutomationException
Returns a new selection That contains the object ids selected by a query over this selection set.

Supported Platforms

Windows, Solaris, Linux

Description

Select will return a new SelectionSet. This subset of the original SelectionSet will contain all of the features that satisfy the attribute and/or spatial query as specified by the IQueryFilter object. If Nothing is given as the IQueryFilter, then the new SelectionSet will contain all of the features from the original SelectionSet.

Parameters:
queryFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
selType - A com.esri.arcgis.geodatabase.esriSelectionType constant (in)
selOption - A com.esri.arcgis.geodatabase.esriSelectionOption constant (in)
selectionContainer - A reference to a com.esri.arcgis.geodatabase.IWorkspace (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.ISelectionSet
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

refresh

public void refresh()
             throws java.io.IOException,
                    AutomationException
Refreshes the state of a snapshot selection.

Supported Platforms

Windows, Solaris, Linux

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

getIDs

public IEnumIDs getIDs()
                throws java.io.IOException,
                       AutomationException
Enumerates the object ids in the selection set.

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumIDs
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeList

public void removeList(int count,
                       int[] oIDList)
                throws java.io.IOException,
                       AutomationException
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeoDatabaseHelper.removeList(com.esri.arcgis.geodatabase.ISelectionSet, int[]).

Removes a list of object id's from the selection set.

Supported Platforms

Windows, Solaris, Linux

Description

Removes a list of OID's from a selection set.
The Count parameter represents the number of elements to remove and the OIDList is a pointer to an array of feature IDs.

Parameters:
count - The count (in)
oIDList - The oIDList (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.