API 0.9.5
CPIndexSet Class Reference

A collection of unique integers. More...

#import <CPIndexSet.h>

Inheritance diagram for CPIndexSet:

List of all members.

Instance Methods

(void) - addIndex:
(void) - addIndexes:
(void) - addIndexesInRange:
(BOOL) - containsIndex:
(BOOL) - containsIndexes:
(BOOL) - containsIndexesInRange:
(id) - copy
(int) - count
(CPString- description
(void) - encodeWithCoder:
(CPInteger) - firstIndex
(CPInteger) - getIndexes:maxCount:inIndexRange:
(CPInteger) - indexGreaterThanIndex:
(CPInteger) - indexGreaterThanOrEqualToIndex:
(CPInteger) - indexLessThanIndex:
(CPInteger) - indexLessThanOrEqualToIndex:
(id) - init
(id) - initWithCoder:
(id) - initWithIndex:
(id) - initWithIndexesInRange:
(id) - initWithIndexSet:
(BOOL) - intersectsIndexesInRange:
(BOOL) - isEqual:
(BOOL) - isEqualToIndexSet:
(CPInteger) - lastIndex
(id) - mutableCopy
(void) - removeAllIndexes
(void) - removeIndex:
(void) - removeIndexes:
(void) - removeIndexesInRange:
(void) - removeMatches:
(void) - shiftIndexesStartingAtIndex:by:

Class Methods

(id) + indexSet
(id) + indexSetWithIndex:
(id) + indexSetWithIndexesInRange:

Detailed Description

A collection of unique integers.

Instances of this class are collections of numbers. Each integer can appear in a collection only once.

Definition at line 4827 of file CPTableView.j.


Method Documentation

- (void) addIndex: (CPInteger)  anIndex

Adds an index to the set.

Parameters:
anIndexthe index to add

Definition at line 492 of file CPIndexSet.j.

- (void) addIndexes: (CPIndexSet anIndexSet

Adds indices to the set

Parameters:
anIndexSeta set of indices to add to the receiver

Definition at line 501 of file CPIndexSet.j.

- (void) addIndexesInRange: (CPRange)  aRange

Adds the range of indices to the set

Parameters:
aRangethe range of numbers to add as indices to the set

Definition at line 515 of file CPIndexSet.j.

- (BOOL) containsIndex: (CPInteger)  anIndex

Returns YES if the index set contains the specified index.

Parameters:
anIndexthe index to check for in the set
Returns:
YES if anIndex is in the receiver index set

Definition at line 183 of file CPIndexSet.j.

- (BOOL) containsIndexes: (CPIndexSet anIndexSet

Returns YES if the receiving index set contains all the indices in the argument.

Parameters:
anIndexSetthe set of indices to check for in the receiving index set

Definition at line 218 of file CPIndexSet.j.

- (BOOL) containsIndexesInRange: (CPRange)  aRange

Returns YES if the index set contains all the numbers in the specified range.

Parameters:
aRangethe range of numbers to check for in the index set

Definition at line 192 of file CPIndexSet.j.

- (id) copy

Creates a deep copy of the index set. The returned copy is mutable. The reason for the two copy methods is for source compatibility with GNUStep code.

Returns:
the index set copy

Definition at line 839 of file CPIndexSet.j.

- (int) count

The number of indices in the set

Definition at line 265 of file CPIndexSet.j.

- (CPString) description

Definition at line 445 of file CPIndexSet.j.

- (void) encodeWithCoder: (CPCoder aCoder

Writes out the index set to the specified coder.

Parameters:
aCoderthe coder to which the index set will be written

Definition at line 815 of file CPIndexSet.j.

- (CPInteger) firstIndex

Return the first index in the set

Definition at line 274 of file CPIndexSet.j.

- (CPInteger) getIndexes: (CPArray anArray
maxCount: (CPInteger)  aMaxCount
inIndexRange: (CPRange)  aRange 

Fills up the specified array with numbers from the index set within the specified range. The method stops filling up the array until the aMaxCount number have been added or the range maximum is reached.

Parameters:
anArraythe array to fill up
aMaxCountthe maximum number of numbers to adds
aRangePointerthe range of indices to add
Returns:
the number of elements added to the array

Definition at line 382 of file CPIndexSet.j.

- (CPInteger) indexGreaterThanIndex: (CPInteger)  anIndex

Returns the first index value in the receiver which is greater than anIndex.

Returns:
the closest index or CPNotFound if no match was found

Definition at line 297 of file CPIndexSet.j.

- (CPInteger) indexGreaterThanOrEqualToIndex: (CPInteger)  anIndex

Returns the first index value in the receiver which is greater than or equal to anIndex.

Returns:
the matching index or CPNotFound if no match was found

Definition at line 359 of file CPIndexSet.j.

- (CPInteger) indexLessThanIndex: (CPInteger)  anIndex

Returns the first index value in the receiver which is less than anIndex.

Returns:
the closest index or CPNotFound if no match was found

Definition at line 328 of file CPIndexSet.j.

- (CPInteger) indexLessThanOrEqualToIndex: (CPInteger)  anIndex

Returns the first index value in the receiver which is less than or equal to anIndex.

Returns:
the matching index or CPNotFound if no match was found

Definition at line 368 of file CPIndexSet.j.

+ (id) indexSet

Returns a new empty index set.

Definition at line 46 of file CPIndexSet.j.

+ (id) indexSetWithIndex: (int)  anIndex

Returns a new index set with just one index.

Definition at line 54 of file CPIndexSet.j.

+ (id) indexSetWithIndexesInRange: (CPRange)  aRange

Returns a new index set with all the numbers in the specified range.

Parameters:
aRangethe range of numbers to add to the index set.

Definition at line 63 of file CPIndexSet.j.

- (id) init

Definition at line 70 of file CPIndexSet.j.

- (id) initWithCoder: (CPCoder aCoder

Initializes the index set from a coder.

Parameters:
aCoderthe coder from which to read the index set data
Returns:
the initialized index set

Definition at line 790 of file CPIndexSet.j.

- (id) initWithIndex: (CPInteger)  anIndex

Initializes the index set with a single index.

Returns:
the initialized index set

Definition at line 79 of file CPIndexSet.j.

- (id) initWithIndexesInRange: (CPRange)  aRange

Initializes the index set with numbers from the specified range.

Parameters:
aRangethe range of numbers to add to the index set
Returns:
the initialized index set

Definition at line 89 of file CPIndexSet.j.

- (id) initWithIndexSet: (CPIndexSet anIndexSet

Initializes the index set with another index set.

Parameters:
anIndexSetthe index set from which to read the initial index set
Returns:
the initialized index set

Definition at line 111 of file CPIndexSet.j.

- (BOOL) intersectsIndexesInRange: (CPRange)  aRange

Checks if the receiver contains at least one number in aRange.

Parameters:
aRangethe range of numbers to check.
Returns:
YES if the receiving index set contains at least one number in the provided range

Definition at line 244 of file CPIndexSet.j.

- (BOOL) isEqual: (id)  anObject

Definition at line 130 of file CPIndexSet.j.

- (BOOL) isEqualToIndexSet: (CPIndexSet anIndexSet

Compares the receiver with the provided index set.

Parameters:
anIndexSetthe index set to compare to
Returns:
YES if the receiver and the index set are functionally equivalent

Definition at line 147 of file CPIndexSet.j.

- (CPInteger) lastIndex

Returns the last index in the set

Definition at line 285 of file CPIndexSet.j.

- (id) mutableCopy

Creates a deep copy of the index set. The returned copy is mutable. The reason for the two copy methods is for source compatibility with GNUStep code.

Returns:
the index set copy

Definition at line 850 of file CPIndexSet.j.

- (void) removeAllIndexes

Removes all indices from the set

Definition at line 607 of file CPIndexSet.j.

- (void) removeIndex: (CPInteger)  anIndex

Removes an index from the set

Parameters:
anIndexthe index to remove

Definition at line 584 of file CPIndexSet.j.

- (void) removeIndexes: (CPIndexSet anIndexSet

Removes the indices from the receiving set.

Parameters:
anIndexSetthe set of indices to remove from the receiver

Definition at line 594 of file CPIndexSet.j.

- (void) removeIndexesInRange: (CPRange)  aRange

Removes the indices in the range from the set.

Parameters:
aRangethe range of indices to remove

Definition at line 618 of file CPIndexSet.j.

- (void) removeMatches: (CPIndexSet otherSet

Definition at line 4829 of file CPTableView.j.

- (void) shiftIndexesStartingAtIndex: (CPInteger)  anIndex
by: (int)  aDelta 

Shifts the values of indices left or right by a specified amount.

Parameters:
anIndexthe index to start the shifting operation from (inclusive)
aDeltathe amount and direction to shift. A positive value shifts to the right. A negative value shifts to the left.

Definition at line 701 of file CPIndexSet.j.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines