com.esri.arcgis.geodatabase
Interface ITableSort

All Superinterfaces:
Serializable
All Known Implementing Classes:
TableSort

public interface ITableSort
extends Serializable

Provides access to members that return and modify information to sort a table.

Description

The ITableSort interface is used to sort data from a table, cursor, or selection set, and returns the sorted rows as a cursor or an ID enumerator.

Remarks

The Fields property is required. It is a comma-delimited list of the fields to be sorted. When the sort method is called, the first field is sorted, then the second field, and so on. The Table property specifies the table or object class on which the sort is to be performed. Alternatively, the Cursor property may be used to indicate the data to be sorted. If you use the Cursor property, you must also set the Table property to the table referenced by the cursor.

If the SelectionSet property is set, the Table property is set automatically, and the Cursor property remains optional.

The Ascending, CaseSensitive, Compare, QueryFilter, SelectionSet, and SortCharacters properties may also be used to further define how the data is to be sorted.

Once the desired sorting properties have been set, the sort method must be called to order the rows. Either the Rows property or the IDs property can then be used to access the data in sorted order.

A custom class that implements ITableSortCallBack can be used to apply a user defined sorting algorithm instead of the default. The Compare property gives the TableSort object access to an instance of a custom class.

Product Availability

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

See Also:
IQueryFilter

Method Summary
 int getIDByIndex(int index)
          A id by its index value.
 IEnumIDs getIDs()
          List of sorted IDs.
 IQueryFilter getQueryFilter()
          The query filter on table or selection set.
 ICursor getRows()
          Cursor of sorted rows.
 ISelectionSet getSelectionSet()
          The selection set as a source of the data to sort on.
 ITable getTable()
          The table as a source of the data to sort on.
 void setAscending(String field, boolean rhs2)
          Field sort order.
 void setCaseSensitive(String field, boolean rhs2)
          Character fields case sensitive.
 void setCompareByRef(ITableSortCallBack rhs1)
          Compare call back interface.
 void setCursorByRef(ICursor rhs1)
          The cursor of the data to sort on.
 void setFields(String rhs1)
          Comma list of field names to sort on.
 void setQueryFilterByRef(IQueryFilter queryFilter)
          The query filter on table or selection set.
 void setSelectionSetByRef(ISelectionSet selectionSet)
          The selection set as a source of the data to sort on.
 void setSortCharacters(String field, int rhs2)
          Number of characters to sort on, for string fields.
 void setTableByRef(ITable table)
          The table as a source of the data to sort on.
 void sort(ITrackCancel trackCancel)
          Sort rows.
 

Method Detail

setTableByRef

void setTableByRef(ITable table)
                   throws IOException,
                          AutomationException
The table as a source of the data to sort on.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setSelectionSetByRef

void setSelectionSetByRef(ISelectionSet selectionSet)
                          throws IOException,
                                 AutomationException
The selection set as a source of the data to sort on. Cancels Cursor.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setCursorByRef

void setCursorByRef(ICursor rhs1)
                    throws IOException,
                           AutomationException
The cursor of the data to sort on. Ensure that sorting fields are available. Cancels SelectionSet.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setQueryFilterByRef

void setQueryFilterByRef(IQueryFilter queryFilter)
                         throws IOException,
                                AutomationException
The query filter on table or selection set.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getQueryFilter

IQueryFilter getQueryFilter()
                            throws IOException,
                                   AutomationException
The query filter on table or selection set.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setFields

void setFields(String rhs1)
               throws IOException,
                      AutomationException
Comma list of field names to sort on.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setAscending

void setAscending(String field,
                  boolean rhs2)
                  throws IOException,
                         AutomationException
Field sort order.

Product Availability

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

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

setSortCharacters

void setSortCharacters(String field,
                       int rhs2)
                       throws IOException,
                              AutomationException
Number of characters to sort on, for string fields. A null (default) sorts on the whole string.

Product Availability

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

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

setCaseSensitive

void setCaseSensitive(String field,
                      boolean rhs2)
                      throws IOException,
                             AutomationException
Character fields case sensitive. Default: False.

Product Availability

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

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

setCompareByRef

void setCompareByRef(ITableSortCallBack rhs1)
                     throws IOException,
                            AutomationException
Compare call back interface. Specify Null (default) for normal behavior.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getIDs

IEnumIDs getIDs()
                throws IOException,
                       AutomationException
List of sorted IDs.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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.

getRows

ICursor getRows()
                throws IOException,
                       AutomationException
Cursor of sorted rows.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

sort

void sort(ITrackCancel trackCancel)
          throws IOException,
                 AutomationException
Sort rows.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getIDByIndex

int getIDByIndex(int index)
                 throws IOException,
                        AutomationException
A id by its index value.

Product Availability

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

Parameters:
index - The index (in)
Returns:
The idVal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTable

ITable getTable()
                throws IOException,
                       AutomationException
The table as a source of the data to sort on.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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.

getSelectionSet

ISelectionSet getSelectionSet()
                              throws IOException,
                                     AutomationException
The selection set as a source of the data to sort on. Cancels Cursor.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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.