Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.

DBCursorPositioning



Adopted By: DBRecordList
DBBinder
Declared In: dbkit/cursors.h



Protocol Description

The DBCursorPositioning protocol lets an object be used as a cursor (or pointer) into a list of records, as contained by a DBRecordList or a DBBinder's container.  You should need to adopt this protocol in a custom class only if you're creating your own container for a DBBinder (in the manner of DBRecordList).  And in that case, you should only access records through methods defined by your container.  In other words, if you position the cursor by sending your object one of the DBCursorPositioning messages, you shouldn't then try to retrieve record values through DBBinder's valueForProperty: method.



Method Types

Setting the position setFirst
setLast
setNext
setPrevious
setTo:
Querying the position currentPosition



Instance Methods

currentPosition
(unsigned int)currentPosition

Returns the index of the record to which the cursor is currently pointing.



setFirst
setFirst

Sets the cursor to point to the first record in the container and returns that record.  Returns nil if the container holds no records.



setLast
setLast

Sets the cursor to point to the last record in the container and returns that record.  Returns nil if the container holds no records.



setNext
setNext

Sets the cursor to point to the next record in the container and returns that record.  Returns nil and doesn't move the cursor if it's currently pointing to the last record.



setPrevious
setPrevious

Sets the cursor to point to the previous record in the container and returns that record.  Returns nil and doesn't move the cursor if it's currently pointing to the first record.



setTo:
setTo:(unsigned int)index

Sets the cursor to point to the index'th record in the container and returns that record.  Returns nil and doesn't move the cursor if index is out of bounds.