00001
00002
00003
00004
00005
00006
00007
00008 #import <Foundation/Foundation.h>
00009
00010
00014 @interface HFIndexSet : NSObject <NSCopying, NSMutableCopying> {
00015 @protected
00016 NSUInteger rangeCount;
00017 NSUInteger rangeCapacity;
00018 HFRange singleRange;
00019 __strong HFRange *multipleRanges;
00020 }
00021
00023 - (id)init;
00024
00026 - (id)initWithValue:(unsigned long long)value;
00027
00029 - (id)initWithValuesInRange:(HFRange)range;
00030
00032 - (id)initWithIndexSet:(HFIndexSet *)otherSet;
00033
00035 - (NSUInteger)numberOfRanges;
00036
00038 - (HFRange)rangeAtIndex:(NSUInteger)idx;
00039
00041 - (unsigned long long)countOfValuesInRange:(HFRange)range;
00042
00044 - (unsigned long long)countOfValues;
00045
00046 #if ! NDEBUG
00047 - (void)verifyIntegrity;
00048 #endif
00049
00051 - (HFRange)rangeContainingValue:(unsigned long long)idx;
00052
00054 - (BOOL)isEqualToNSIndexSet:(NSIndexSet *)indexSet;
00055
00056 @end
00057
00061 @interface HFMutableIndexSet : HFIndexSet
00062
00064 - (void)addIndexesInRange:(HFRange)range;
00065
00067 - (void)removeIndexesInRange:(HFRange)range;
00068
00070 - (void)shiftValuesRightByAmount:(unsigned long long)delta startingAtValue:(unsigned long long)value;
00071
00073 - (void)shiftValuesLeftByAmount:(unsigned long long)delta startingAtValue:(unsigned long long)value;
00074
00076 - (void)shiftValuesLeftByAmount:(unsigned long long)delta endingAtValue:(unsigned long long)value;
00077
00078 @end