public interface IDataIndexCursor extends IDataCursor
This cursor class has been deprecated. To position a cursor at a specific index, you may loop to that index using the next method in the IDataCursor class. The following is a simple example.
//---This method finds the Nth element and returns null if there is no element N. Object getElement(int n, IData data) { IDataCursor cur = data.getCursor(); int i = 0; while (cur.next()) { if (i == n) break; i++; } return cur.getValue(); }
Note: The contents of an IData object is not necessarily synchronized, so information, such as the value returned by count, might not be accurate if multiple cursors modify a single IData.
IData
,
IDataFactory
,
IDataCursor
,
IDataHashCursor
,
IDataTreeCursor
Modifier and Type | Method and Description |
---|---|
int |
count()
Deprecated.
Replaced by
IDataUtil.size(IDataCursor) . |
boolean |
seek(int index)
Deprecated.
No replacement.
|
delete, destroy, first, first, getCursorClone, getKey, getLastError, getValue, hasMoreData, hasMoreErrors, insertAfter, insertBefore, insertDataAfter, insertDataBefore, last, last, next, next, previous, previous, setErrorMode, setKey, setValue
boolean seek(int index)
index
- an int specifying the index to which you want the cursor moved. The first entry in an IData object is index 0.int count()
IDataUtil.size(IDataCursor)
.