com.esri.arcgis.geodatabase
Class SelectionSet

java.lang.Object
  extended by com.esri.arcgis.geodatabase.SelectionSet
All Implemented Interfaces:
ISelectionSet, ISelectionSet2, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class SelectionSet
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ISelectionSet, ISelectionSet2

ESRI Selection Set object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
SelectionSet(Object obj)
          Construct a SelectionSet using a reference to such an object returned from ArcGIS Engine or Server.
 
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.
 boolean equals(Object o)
          Compare this object with another
 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.
 int hashCode()
          the hashcode for this object
 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 queryFilter, boolean recycling, ICursor[] cursor)
          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.
 void update(IQueryFilter queryFilter, boolean recycling, ICursor[] cursor)
          Returns a cursor that can be used to update the objects specified by a query over this selection set.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

SelectionSet

public SelectionSet(Object obj)
             throws IOException
Construct a SelectionSet using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to SelectionSet.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
SelectionSet o = (SelectionSet)obj; // will not work

SelectionSet o = new SelectionSet(obj); // Use this constructor instead
* @param obj an object returned from ArcGIS Engine or Server

Throws:
IOException - if there are interop problems SelectionSet theSelectionSet = (SelectionSet) obj;
Method Detail

equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getFullName

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

Remarks

The FullName property has not been implemented.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFullName in interface ISelectionSet
Returns:
A reference to a com.esri.arcgis.system.IName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTarget

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

Remarks

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getTarget in interface ISelectionSet
Returns:
A reference to a com.esri.arcgis.geodatabase.ITable
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

makePermanent

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

Remarks

This method is not currently implemented.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
makePermanent in interface ISelectionSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCount

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getCount in interface ISelectionSet
Returns:
The numObjectIds
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

add

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
add in interface ISelectionSet
Parameters:
oID - The oID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addList

public void addList(int count,
                    int[] oIDList)
             throws 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.

Remarks

This method should not be called by .NET or Java applications. Instead, call IGeoDatabaseBridge2.AddList.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
addList in interface ISelectionSet
Parameters:
count - The count (in)
oIDList - The oIDList (in)
Throws:
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 IOException,
                    AutomationException
Combines this selection set with another selection set using the specified set operation.

Remarks

Used to combine to SelectionSets. The resultSet parameter must be a third selection set and not any of the ones that are combined. For example, if you want to combine A and B and put the result in A, you must combine A and B into C, and then set A to C.

To combine two selection sets, the sets must be derived from the same table or feature class. Attempting to combine selection sets from different datasets will raise an error.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
combine in interface ISelectionSet
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:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

search

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

Remarks

Search will return an ICursor with all of the rows that satisfy the constraints specified by a query filter. If a null value is provided for the QueryFilter parameter, the cursor will contain all of the selection set's rows.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
search in interface ISelectionSet
Parameters:
queryFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
recycling - The recycling (in)
cursor - A reference to a com.esri.arcgis.geodatabase.ICursor (out: use single element array)
Throws:
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 IOException,
                            AutomationException
Returns a new selection That contains the object ids selected by a query over this selection set.

Description

Select will return a new selection set. This subset of the original selection set will contain all of the rows that satisfy the attribute and/or spatial constraints as specified by the IQueryFilter object. If a null value is passed as the QueryFilter parameter, the new selection set will contain all of the rows from the original selection set.

When calling Select, the selectionContainer parameter is no longer needed; a null value can be provided.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
select in interface ISelectionSet
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:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

refresh

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
refresh in interface ISelectionSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getIDs

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getIDs in interface ISelectionSet
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumIDs
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

removeList

public void removeList(int count,
                       int[] oIDList)
                throws 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.

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.

Remarks

This method should not be called by .NET or Java applications. Instead, call IGeoDatabaseBridge2.RemoveList.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
removeList in interface ISelectionSet
Parameters:
count - The count (in)
oIDList - The oIDList (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

update

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

Description

The Update method returns an 'update' cursor that can be used to update or delete rows. It offers somewhat faster performance than multiple calls to Store or Delete on row objects fetched using a non-recycling search cursor for tables storing simple rows and simple features. There is no difference in performance for custom features.

Remarks

All edits to features that participate in a Topology or Geometric Network must be bracketed within an edit operation.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
update in interface ISelectionSet2
Parameters:
queryFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
recycling - The recycling (in)
cursor - A reference to a com.esri.arcgis.geodatabase.ICursor (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.