# NSIndexSet documentation

rfm@gnu.org
Generated at 2025-02-13 06:02:40 +0000
2004 Free Software Foundation, Inc.
Software documentation for the NSIndexSet class
Foundation/NSIndexSet.h
NSCopying
NSMutableCopying
NSCoding
Instances of this class are collections of unsigned integers in the range 0 to NSNotFound-1.
Each integer can appear in a collection only once.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
indexSet
Return an empty set.
indexSetWithIndex:
anIndex
Return a set containing the single value anIndex, or returns `nil` if anIndex is NSNotFound.
indexSetWithIndexesInRange:
aRange
Return a set containing all the values in aRange, or returns `nil` if aRange contains NSNotFound.
containsIndex:
anIndex
Returns `YES` if the receiver contains anIndex, `NO` otherwise.
containsIndexes:
aSet
Returns `YES` if the receiver contains all the index values present in aSet, `NO` otherwise.
containsIndexesInRange:
aRange
Returns `YES` if the receiver contains all the index values present in aRange, `NO` otherwise.
count
Returns the number of index values present in the receiver.
countOfIndexesInRange:
range
Not implemented Returns the number of indexes set within the specified range.
enumerateIndexesInRange:
range
options:
opts
usingBlock:
aBlock
Description forthcoming.
enumerateIndexesUsingBlock:
aBlock
Enumerate all indices in the set by applying a block to them.
enumerateIndexesWithOptions:
opts
usingBlock:
aBlock
Description forthcoming.
enumerateRangesInRange:
range
options:
opts
usingBlock:
aBlock
Description forthcoming.
enumerateRangesUsingBlock:
aBlock
Description forthcoming.
enumerateRangesWithOptions:
opts
usingBlock:
aBlock
Description forthcoming.
firstIndex
Returns the first index value in the receiver or NSNotFound if the receiver is empty.
getIndexes:
aBuffer
maxCount:
aCount
inIndexRange:
aRange
Copies index values into aBuffer until there are no index values left or aBuffer is full (assuming that the size of aBuffer is given by aCount).
Only copies index values present in aRange and copies them in order.
Returns the number of index values placed in aBuffer.
Modifies aRange to start after the last index value copied.
If aRange is a null pointer, this method attempts to get all index values from the set (and of course no range can be returned in it).
indexGreaterThanIndex:
anIndex
Return the first index value in the receiver which is greater than anIndex.
indexGreaterThanOrEqualToIndex:
anIndex
Return the first index value in the receiver which is greater than or equal to anIndex.
indexLessThanIndex:
anIndex
Return the first index value in the receiver which is less than anIndex.
indexLessThanOrEqualToIndex:
anIndex
Return the first index value in the receiver which is less than or equal to anIndex.
initWithIndex:
anIndex
Initialise the receiver to contain anIndex. Returns the initialised object or `nil` if anIndex is NSNotFound.
initWithIndexSet:
aSet
Initialises the receiver with the index values from aSet.
initWithIndexesInRange:
aRange
Initialise the receiver to contain all index values in aRange. Returns the initialised object or `nil` if aRange contains NSNotFound.
intersectsIndexesInRange:
aRange
Returns `YES` if the receiver contains any index values which lie in aRange, No otherwise.
isEqualToIndexSet:
aSet
Tests two index sets for equality and returns either `YES` or `NO`.
lastIndex
Returns the last index value in the receiver or NSNotFound if the receiver is empty.
Software documentation for the NSMutableIndexSet class
Foundation/NSIndexSet.h
Description forthcoming.
addIndex:
anIndex
Adds anIndex to the set of indexes stored in the receiver.
addIndexes:
aSet
Adds all the indexes from aSet to the set of indexes stored in the receiver.
addIndexesInRange:
aRange
Adds all the indexes in aRange to the set of indexes stored in the receiver.
removeAllIndexes
Removes all indexes stored in the receiver.
removeIndex:
anIndex
Removes anIndex from the set of indexes stored in the receiver.
removeIndexes:
aSet
Removes all the indexes in aSet from the set of indexes stored in the receiver.
removeIndexesInRange:
aRange
Removes all the indexes in aRange from the set of indexes stored in the receiver.
shiftIndexesStartingAtIndex:
anIndex
by:
amount
Moves all the indexes from anIndex upwards by the amount specified.
If amount is negative, index values below anIndex will be overwritten by the shifted values.
If amount is positive, a 'hole' will be left in the index range after anIndex.