Copyright ©1995 by NeXT Computer, Inc. All Rights Reserved.
| IXPostingOperations |
| Adopted By: | IXPostingCursor IXPostingSet | |
| Declared In: | btree/protocols.h |
| Protocol Description |
| The IXPostingOperations protocol defines methods for manipulating postings. See the IXPostingExchange protocol specification for a description of the term "posting."
The IXPostingOperations protocol requires the implementor to logically order its postings by handle, eliminating duplicates, and to maintain a cursor on this ordering which defines a current selection. This protocol defines methods for the selection of postings by position or by handle, and for iteration over the entire set of postings. |
| Method Types |
| Manipulating postings by handle |
| Getting the number of postings | ||
| Emptying a posting set | ||
| Traversing a posting set |
| Instance Methods |
| addHandle:withWeight: |
| Adds a posting consisting of aHandle and aWeight to the set. If aHandle is already present, assigns the posting a new weight by averaging aWeight and the existing weight. (Note: if aHandle is already present, IXPostingCursor overwrites the existing weight with aWeight). Returns self.
See also: |
| count |
| Returns the number of postings in the set. |
| empty |
| Removes all postings from the set. Returns self.
See also: |
| getHandle:andWeight: |
| Returns by reference the handle and weight of the selected posting. Explicitly returns the handle, or 0 if the current selection is undefined.
See also: |
| removeHandle: |
| If a posting with handle aHandle exists, removes that posting. Returns self.
See also: |
| setFirstHandle |
| Selects the first posting, and returns that posting's handle, or 0 if the set is empty.
See also: |
| setHandle: |
| Selects the posting with handle aHandle, and returns that posting's handle. If the value returned isn't aHandle, that posting wasn't found, and the next higher-numbered posting is selected.
Note: For both IXPostingSet and IXPostingCursor, this is an efficient operation, with a cost on the order of Olog2(n), where n is the number of postings. See also: |
| setNextHandle |
| Selects the next posting. Returns the handle for that posting, or 0 if there are no more postings.
See also: |