API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
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) - removeMatches:
 
(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:
 
(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:
 
(Class) + class
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Additional Inherited Members

- Instance Variables inherited from CPObject
Class isa
 

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

- (void) addIndex: (CPInteger)  anIndex
implementation

Adds an index to the set.

Parameters
anIndexthe index to add

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 708 of file CPIndexSet.j.

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

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

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

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

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

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

- (int) count
implementation

The number of indices in the set

Definition at line 268 of file CPIndexSet.j.

- (CPString) description
implementation

Returns a human readable string describing the receiver

Reimplemented from CPObject.

Definition at line 448 of file CPIndexSet.j.

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

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

Definition at line 498 of file CPIndexSet.j.

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

Definition at line 486 of file CPIndexSet.j.

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

Definition at line 491 of file CPIndexSet.j.

- (CPInteger) firstIndex
implementation

Return the first index in the set

Definition at line 277 of file CPIndexSet.j.

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

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

Definition at line 638 of file CPIndexSet.j.

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

Definition at line 558 of file CPIndexSet.j.

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

Definition at line 571 of file CPIndexSet.j.

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

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

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

Definition at line 579 of file CPIndexSet.j.

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

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

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

Definition at line 553 of file CPIndexSet.j.

+ (id) indexSet
implementation

Returns a new empty index set.

Definition at line 45 of file CPIndexSet.j.

+ (id) indexSetWithIndex: (int)  anIndex
implementation

Returns a new index set with just one index.

Definition at line 53 of file CPIndexSet.j.

+ (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 62 of file CPIndexSet.j.

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

Definition at line 563 of file CPIndexSet.j.

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Definition at line 69 of file CPIndexSet.j.

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

- (id) initWithIndex: (CPInteger)  anIndex
implementation

Initializes the index set with a single index.

Returns
the initialized index set

Definition at line 78 of file CPIndexSet.j.

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

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

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

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

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

- (CPInteger) lastIndex
implementation

Returns the last index in the set

Definition at line 288 of file CPIndexSet.j.

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

- (void) removeAllIndexes
implementation

Removes all indices from the set

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 823 of file CPIndexSet.j.

- (void) removeIndex: (CPInteger)  anIndex
implementation

Removes an index from the set

Parameters
anIndexthe index to remove

Provided by category CPIndexSet(CPMutableIndexSet).

Definition at line 800 of file CPIndexSet.j.

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

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

- (void) removeMatches: (CPIndexSet otherSet
implementation

Provided by category CPIndexSet(tableview).

Definition at line 4936 of file CPTableView.j.

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


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