API  1.0.0
CPIndexSet Class Reference

A collection of unique integers. More...

#import <CPIndexSet.h>

+ Inheritance diagram for CPIndexSet:

Instance Methods

(void) - addIndex:
 
(void) - addIndexes:
 
(void) - addIndexesInRange:
 
(BOOL) - containsIndex:
 
(BOOL) - containsIndexes:
 
(BOOL) - containsIndexesInRange:
 
(id) - copy
 
(int) - count
 
(CPString- description
 
(void) - encodeWithCoder:
 
(void) - enumerateIndexesInRange:options:usingBlock:
 
(void) - enumerateIndexesUsingBlock:
 
(void) - enumerateIndexesWithOptions:usingBlock:
 
(CPInteger) - firstIndex
 
(CPInteger) - getIndexes:maxCount:inIndexRange:
 
(CPIndexSet- indexesInRange:options:passingTest:
 
(CPIndexSet- indexesPassingTest:
 
(CPIndexSet- indexesWithOptions:passingTest:
 
(CPInteger) - indexGreaterThanIndex:
 
(CPInteger) - indexGreaterThanOrEqualToIndex:
 
(unsigned) - indexInRange:options:passingTest:
 
(CPInteger) - indexLessThanIndex:
 
(CPInteger) - indexLessThanOrEqualToIndex:
 
(unsigned) - indexPassingTest:
 
(unsigned) - indexWithOptions:passingTest:
 
(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) - shiftIndexesStartingAtIndex:by:
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(void) - dealloc
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(id) + indexSet
 
(id) + indexSetWithIndex:
 
(id) + indexSetWithIndexesInRange:
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

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 2 of file CPIndexSet.h.

Method Documentation

◆ addIndex:()

- (void) addIndex: (CPInteger)  anIndex
implementation

Adds an index to the set.

Parameters
anIndexthe index to add

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 709 of file CPIndexSet.j.

◆ addIndexes:()

- (void) addIndexes: (CPIndexSet anIndexSet
implementation

Adds indices to the set

Parameters
anIndexSeta set of indices to add to the receiver

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 718 of file CPIndexSet.j.

◆ addIndexesInRange:()

- (void) addIndexesInRange: (CPRange)  aRange
implementation

Adds the range of indices to the set

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

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 732 of file CPIndexSet.j.

◆ containsIndex:()

- (BOOL) containsIndex: (CPInteger)  anIndex
implementation

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 187 of file CPIndexSet.j.

◆ containsIndexes:()

- (BOOL) containsIndexes: (CPIndexSet anIndexSet
implementation

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 222 of file CPIndexSet.j.

◆ containsIndexesInRange:()

- (BOOL) containsIndexesInRange: (CPRange)  aRange
implementation

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 196 of file CPIndexSet.j.

◆ copy()

- (id) copy
implementation

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

Reimplemented from CPObject.

Provided by category CPIndexSet(CPCopying).

Definition at line 1058 of file CPIndexSet.j.

◆ count()

- (int) count
implementation

The number of indices in the set

Definition at line 269 of file CPIndexSet.j.

◆ description()

- (CPString) description
implementation

Returns a human readable string describing the receiver

Reimplemented from CPObject.

Definition at line 449 of file CPIndexSet.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Writes out the index set to the specified coder.

Parameters
aCoderthe coder to which the index set will be written

Provided by category CPIndexSet(CPCoding).

Definition at line 1034 of file CPIndexSet.j.

◆ enumerateIndexesInRange:options:usingBlock:()

- (void) enumerateIndexesInRange: (CPRange)  enumerationRange
options: (CPEnumerationOptions)  options
usingBlock: (Function /*(int idx, @ref BOOL stop)*/)  aFunction 
implementation

Definition at line 499 of file CPIndexSet.j.

◆ enumerateIndexesUsingBlock:()

- (void) enumerateIndexesUsingBlock: (Function /*(int idx, @ref BOOL stop)*/)  aFunction
implementation

Definition at line 487 of file CPIndexSet.j.

◆ enumerateIndexesWithOptions:usingBlock:()

- (void) enumerateIndexesWithOptions: (CPEnumerationOptions)  options
usingBlock: (Function /*(int idx, @ref BOOL stop)*/)  aFunction 
implementation

Definition at line 492 of file CPIndexSet.j.

◆ firstIndex()

- (CPInteger) firstIndex
implementation

Return the first index in the set

Definition at line 278 of file CPIndexSet.j.

◆ getIndexes:maxCount:inIndexRange:()

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

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 386 of file CPIndexSet.j.

◆ indexesInRange:options:passingTest:()

- (CPIndexSet) indexesInRange: (CPRange)  aRange
options: (CPEnumerationOptions)  anOptions
passingTest: (Function /*(int anIndex)*/)  aPredicate 
implementation

Definition at line 639 of file CPIndexSet.j.

◆ indexesPassingTest:()

- (CPIndexSet) indexesPassingTest: (Function /*(int anIndex)*/)  aPredicate
implementation

Definition at line 559 of file CPIndexSet.j.

◆ indexesWithOptions:passingTest:()

- (CPIndexSet) indexesWithOptions: (CPEnumerationOptions)  anOptions
passingTest: (Function /*(int anIndex)*/)  aPredicate 
implementation

Definition at line 572 of file CPIndexSet.j.

◆ indexGreaterThanIndex:()

- (CPInteger) indexGreaterThanIndex: (CPInteger)  anIndex
implementation

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 301 of file CPIndexSet.j.

◆ indexGreaterThanOrEqualToIndex:()

- (CPInteger) indexGreaterThanOrEqualToIndex: (CPInteger)  anIndex
implementation

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 363 of file CPIndexSet.j.

◆ indexInRange:options:passingTest:()

- (unsigned) indexInRange: (CPRange)  aRange
options: (CPEnumerationOptions)  anOptions
passingTest: (Function /*(int anIndex)*/)  aPredicate 
implementation

Definition at line 580 of file CPIndexSet.j.

◆ indexLessThanIndex:()

- (CPInteger) indexLessThanIndex: (CPInteger)  anIndex
implementation

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 332 of file CPIndexSet.j.

◆ indexLessThanOrEqualToIndex:()

- (CPInteger) indexLessThanOrEqualToIndex: (CPInteger)  anIndex
implementation

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 372 of file CPIndexSet.j.

◆ indexPassingTest:()

- (unsigned) indexPassingTest: (Function /*(int anIndex)*/)  aPredicate
implementation

Definition at line 554 of file CPIndexSet.j.

◆ indexSet()

+ (id) indexSet
implementation

Returns a new empty index set.

Definition at line 43 of file CPIndexSet.j.

◆ indexSetWithIndex:()

+ (id) indexSetWithIndex: (int)  anIndex
implementation

Returns a new index set with just one index.

Definition at line 51 of file CPIndexSet.j.

◆ indexSetWithIndexesInRange:()

+ (id) indexSetWithIndexesInRange: (CPRange)  aRange
implementation

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 60 of file CPIndexSet.j.

◆ indexWithOptions:passingTest:()

- (unsigned) indexWithOptions: (CPEnumerationOptions)  anOptions
passingTest: (Function /*(int anIndex)*/)  aPredicate 
implementation

Definition at line 564 of file CPIndexSet.j.

◆ init()

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Definition at line 67 of file CPIndexSet.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the index set from a coder.

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

Provided by category CPIndexSet(CPCoding).

Definition at line 1010 of file CPIndexSet.j.

◆ initWithIndex:()

- (id) initWithIndex: (CPInteger)  anIndex
implementation

Initializes the index set with a single index.

Returns
the initialized index set

Definition at line 76 of file CPIndexSet.j.

◆ initWithIndexesInRange:()

- (id) initWithIndexesInRange: (CPRange)  aRange
implementation

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 90 of file CPIndexSet.j.

◆ initWithIndexSet:()

- (id) initWithIndexSet: (CPIndexSet anIndexSet
implementation

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 115 of file CPIndexSet.j.

◆ intersectsIndexesInRange:()

- (BOOL) intersectsIndexesInRange: (CPRange)  aRange
implementation

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 248 of file CPIndexSet.j.

◆ isEqual:()

- (BOOL) isEqual: (id)  anObject
implementation

Determines if anObject is functionally equivalent to the receiver.

Returns
YES if anObject is functionally equivalent to the receiver.

Reimplemented from CPObject.

Definition at line 134 of file CPIndexSet.j.

◆ isEqualToIndexSet:()

- (BOOL) isEqualToIndexSet: (CPIndexSet anIndexSet
implementation

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 151 of file CPIndexSet.j.

◆ lastIndex()

- (CPInteger) lastIndex
implementation

Returns the last index in the set

Definition at line 289 of file CPIndexSet.j.

◆ mutableCopy()

- (id) mutableCopy
implementation

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

Reimplemented from CPObject.

Provided by category CPIndexSet(CPCopying).

Definition at line 1069 of file CPIndexSet.j.

◆ removeAllIndexes()

- (void) removeAllIndexes
implementation

Removes all indices from the set

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 827 of file CPIndexSet.j.

◆ removeIndex:()

- (void) removeIndex: (CPInteger)  anIndex
implementation

Removes an index from the set

Parameters
anIndexthe index to remove

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 804 of file CPIndexSet.j.

◆ removeIndexes:()

- (void) removeIndexes: (CPIndexSet anIndexSet
implementation

Removes the indices from the receiving set.

Parameters
anIndexSetthe set of indices to remove from the receiver

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 814 of file CPIndexSet.j.

◆ removeIndexesInRange:()

- (void) removeIndexesInRange: (CPRange)  aRange
implementation

Removes the indices in the range from the set.

Parameters
aRangethe range of indices to remove

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 838 of file CPIndexSet.j.

◆ shiftIndexesStartingAtIndex:by:()

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

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.

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 921 of file CPIndexSet.j.


The documentation for this class was generated from the following files: