Copyright ©1995 by NeXT Computer, Inc. All Rights Reserved.
|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.
|Manipulating postings by handle|
|Getting the number of postings||count|
|Emptying a posting set||empty|
|Traversing a posting set||setHandle:|
|addHandle:(unsigned int)aHandle withWeight:(unsigned int)aWeight|
|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: removeHandle:, getHandle:andWeight:
|Returns the number of postings in the set.|
|Removes all postings from the set. Returns self.
See also: removeHandle:
|(unsigned int)getHandle:(unsigned int *)aHandle andWeight:(unsigned int *)aWeight|
|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: setHandle:
|If a posting with handle aHandle exists, removes that posting. Returns self.
See also: addHandle:withWeight:, getHandle:andWeight:
|Selects the first posting, and returns that posting's handle, or 0 if the set is empty.
See also: setNextHandle, setHandle:
|(unsigned int)setHandle:(unsigned int)aHandle|
|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: getHandle:andWeight:
|Selects the next posting. Returns the handle for that posting, or 0 if there are no more postings.
See also: setFirstHandle, setHandle: