com.esri.arcgis.geodatabase
Class ICursorProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.geodatabase.ICursorProxy
All Implemented Interfaces:
ICursor, Externalizable, Serializable

public class ICursorProxy
extends com.esri.arcgis.interop.Dispatch
implements ICursor, Serializable

Provides access to members that hand out enumerated rows, field collections and allows for the updating, deleting and inserting of rows.

Remarks

Cursors are forward only; they do not support backing up and retrieving rows that have already been retrieved or making multiple passes over data. If an application needs to make multiple passes over the data, the application needs to reexecute the query that returned the cursor. If both executions of the query are made within the same edit session (or database transaction with the appropriate level of isolation), the application is guaranteed not to see any changes made to the data by other concurrently executing applications.

Note that while a cursor is created in the client's memory after a call to methods such as ITable.Search or ITable.Insert, the DBMS cursor is not created until a call to NextRow (or a similar method) is made. This is why retrieving the first row may take longer than subsequent rows, and because underlying DBMS errors might be raised on the call, error handling is recommended.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

Product Availability

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

See Also:
Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  ICursorProxy()
           
  ICursorProxy(Object obj)
           
protected ICursorProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void deleteRow()
          Delete the existing Row in the database corresponding to the current position of the cursor.
 int findField(String name)
          The index of the field with the specified name.
 void flush()
          Flush any outstanding buffered writes to the database.
 IFields getFields()
          The Fields Collection for this cursor.
 Object insertRow(IRowBuffer buffer)
          Insert a new Row into the database using the property values in the input buffer.
 IRow nextRow()
          Advance the position of the cursor by one and return the Row object at that position.
 void removeListener(String iidStr, Object theListener)
           
 void updateRow(IRow row)
          Update the existing Row in the database corresponding to the current position of the cursor.
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

ICursorProxy

public ICursorProxy()

ICursorProxy

public ICursorProxy(Object obj)
             throws IOException
Throws:
IOException

ICursorProxy

protected ICursorProxy(Object obj,
                       String iid)
                throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

findField

public int findField(String name)
              throws IOException,
                     AutomationException
The index of the field with the specified name.

Remarks

If the specified field cannot be found, this method returns a value of -1.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
findField in interface ICursor
Parameters:
name - The name (in)
Returns:
The fieldIndex
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFields

public IFields getFields()
                  throws IOException,
                         AutomationException
The Fields Collection for this cursor.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

nextRow

public IRow nextRow()
             throws IOException,
                    AutomationException
Advance the position of the cursor by one and return the Row object at that position.

Remarks

The NextRow method on a search or update cursor returns the next row in the result set to the application. The row object returned is allocated and hydrated by the cursor, and a reference to it is handed to the application. To retrieve all rows in a result set containing N rows, the application must make N calls to NextRow. If no rows remain in the result set, this method returns a null value.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

updateRow

public void updateRow(IRow row)
               throws IOException,
                      AutomationException
Update the existing Row in the database corresponding to the current position of the cursor.

Remarks

This method should only be called on update cursors.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

deleteRow

public void deleteRow()
               throws IOException,
                      AutomationException
Delete the existing Row in the database corresponding to the current position of the cursor.

Remarks

The cursor must be initialized to a row (with the NextRow method) before this method can be successfully called.

This should only be called on update cursors. To delete a row retrieved from a search cursor, call IRow.Delete on the row itself.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

insertRow

public Object insertRow(IRowBuffer buffer)
                 throws IOException,
                        AutomationException
Insert a new Row into the database using the property values in the input buffer. The object ID of the new Row, if there is one, is returned.

Remarks

This method should only be called on insert cursors.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
insertRow in interface ICursor
Parameters:
buffer - A reference to a com.esri.arcgis.geodatabase.IRowBuffer (in)
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

flush

public void flush()
           throws IOException,
                  AutomationException
Flush any outstanding buffered writes to the database.

Remarks

This method should only be called on insert cursors.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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