Next Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

NSMutableIndexSet

Inherits from
Implements
Package
com.apple.cocoa.foundation
Availability
Available in Mac OS X v10.3 and later.
Companion guide

Overview

NSMutableIndexSet manages a mutable collection of unsigned integers. This collection is referred to as an index set and is composed of a series of indexes. A given index can appear only once in an index set. The values in an index set are always sorted, so the order in which values are added is irrelevant.

Internally, indexes are represented in ranges. Thus, an index set includes the integer members of a range or of many ranges. For maximum performance and efficiency, overlapping ranges in an index set are automatically coalesced (ranges merge rather than overlap).

NSMutableIndexSet is not intended to be subclassed.

Tasks

Constructors

Adding Indexes

Removing Indexes

Shifting Indexes in an Index Set

Constructors

NSMutableIndexSet

Creates and returns an NSMutableIndexSet containing the indexes specified by NSRange.ZeroRange.

public NSMutableIndexSet()

Availability

Creates and returns an NSMutableIndexSet containing a single index, value.

public NSMutableIndexSet(int value)

Availability

Creates and returns an NSMutableIndexSet containing the indexes specified by range.

public NSMutableIndexSet(NSRange range)

Availability

Creates and returns an NSMutableIndexSet containing the indexes in indexSet.

public NSMutableIndexSet(NSIndexSet indexSet)

Availability

Instance Methods

addIndex

Adds the index specified by value to the receiver.

public void addIndex(int value)

Discussion

This method throws a RangeException if the addition of value to the index set would exceed the maximum range allowed by NSIndexSet.

Availability
See Also

addIndexes

public void addIndexes(NSIndexSet indexSet)

Discussion

Adds the indexes specified by indexSet to the receiver.

Availability
See Also

addIndexesInRange

Adds the indexes specified by range to the receiver.

public void addIndexesInRange(NSRange range)

Discussion

This method throws a RangeException if the addition of the indexes specified by range would exceed the maximum range allowed by NSIndexSet.

Availability
See Also

removeAllIndexes

Removes all the indexes from the receiver.

public void removeAllIndexes()

Availability
See Also

removeIndex

Removes the index specified by value from the receiver.

public void removeIndex(int value)

Availability
See Also

removeIndexes

Removes the indexes contained in indexSet from the receiver.

public void removeIndexes(NSIndexSet indexSet)

Availability
See Also

removeIndexesInRange

Removes the indexes specified by range from the receiver.

public void removeIndexesInRange(NSRange range)

Availability
See Also

shiftIndexes

public void shiftIndexes(int index, int delta)

Discussion

For a positive delta, shifts the indexes in [index, INT_MAX] to the right, thereby inserting an "empty space" in the range [index, delta]. For a negative delta, shifts the indexes in [index, INT_MAX] to the left, thereby deleting the indexes in the range [index - delta, delta].

Availability


Next Page > Hide TOC


© 1997, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-07-24)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.