21 #import <scl/SCCollection.h>
22 #import <scl/SCSorterProtocol.h>
23 #import <scl/SCIndexedCollection.h>
24 #import <scl/SCMutableIndexedCollection.h>
27 #pragma mark Константы класса
32 #define SCOrderedSetClass @"SCOrderedSet"
75 NSMutableOrderedSet *fOrderedSet;
124 @property (nonatomic, retain, readonly, getter=
firstObject)
id firstObject;
130 @property (nonatomic, retain, readonly, getter=
firstString) NSString *firstString;
136 @property (nonatomic, retain, readonly, getter=
firstNumber) NSNumber *firstNumber;
142 @property (nonatomic, retain, readonly, getter=
lastObject)
id lastObject;
148 @property (nonatomic, retain, readonly, getter=
lastString) NSString *lastString;
154 @property (nonatomic, retain, readonly, getter=
lastNumber) NSNumber *lastNumber;
178 #pragma mark Создание упорядоченных множеств
180 + (
SCOrderedSet *)orderedSetWithContentsOfSerializedFile:(NSString *)path;
181 + (
SCOrderedSet *)orderedSetWithDataDictionary:(NSDictionary *)dictionary;
182 + (
SCOrderedSet *)orderedSetWithDataDictionaryFromFile:(NSString *)path;
184 + (
SCOrderedSet *)orderedSetWithFileStream:(NSString *)path;
188 + (
SCOrderedSet *)orderedSetWithObjects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
189 + (
SCOrderedSet *)orderedSetWithCollection:(
id)collection;
195 + (
SCOrderedSet *)orderedSetWithAscendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
196 + (
SCOrderedSet *)orderedSetWithDescendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
198 + (
SCOrderedSet *)orderedSetWithAscendingSortedCollection:(
id)collection;
199 + (
SCOrderedSet *)orderedSetWithDescendingSortedCollection:(
id)collection;
200 + (
SCOrderedSet *)orderedSetWithSortedCollection:(
id)collection;
203 #pragma mark Инициализация упорядоченных множеств
204 - (id)initWithName:(NSString *)name;
205 - (id)initWithObject:(
id)object;
206 - (id)initWithObjects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
207 - (id)initWithCollection:(
id)collection;
208 - (id)initWithArray:(
SCArray *)array;
209 - (id)initWithSet:(
SCSet *)set;
213 - (id)initWithAscendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
214 - (id)initWithDescendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
215 - (id)initWithSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
216 - (id)initWithAscendingSortedCollection:(
id)collection;
217 - (id)initWithDescendingSortedCollection:(
id)collection;
218 - (id)initWithSortedCollection:(
id)collection;
221 #pragma mark Копирование упорядоченных множеств
222 - (void)setSet:(
SCSet *)set;
224 - (void)setAscendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
225 - (void)setDescendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
226 - (void)setSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
227 - (void)setAscendingSortedCollection:(
id)collection;
228 - (void)setDescendingSortedCollection:(
id)collection;
229 - (void)setSortedCollection:(
id)collection;
232 #pragma mark Сравнение упорядоченных множеств
233 - (BOOL)isSubsetOfOrderedSet:(
id)orderedSet;
234 - (BOOL)isSubsetOfSet:(
id)set;
235 - (BOOL)intersectsOrderedSet:(
id)orderedSet;
236 - (BOOL)intersectsSet:(
id)set;
237 - (BOOL)isEqualToOrderedSet:(
id)orderedSet;
238 - (BOOL)isEqualToContentsOfOrderedSet:(
SCOrderedSet *)orderedSet;
241 #pragma mark Сортировка упорядоченных множеств
242 - (void)sortAscendingWithSorter:(
id<
SCSorter>)sorter;
243 - (void)sortDescendingWithSorter:(
id<
SCSorter>)sorter;
244 - (void)sortWithSorter:(
id<
SCSorter>)sorter;
245 - (void)sortAscending;
246 - (void)sortDescending;
256 #pragma mark Добавление объектов
257 - (void)insertObject:(
id)object atIndex:(
SCIndex)index;
266 - (void)insertChar:(
char)value atIndex:(
SCIndex)index;
267 - (void)insertUnichar:(unichar)value atIndex:(
SCIndex)index;
268 - (void)insertCharString:(const
char *)string atIndex:(
SCIndex)index;
269 - (void)insertBool:(BOOL)value atIndex:(
SCIndex)index;
273 - (void)setObject:(
id)object atIndex:(
SCIndex)index;
282 - (void)setChar:(
char)value atIndex:(
SCIndex)index;
283 - (void)setUnichar:(unichar)value atIndex:(
SCIndex)index;
284 - (void)setCharString:(const
char *)string atIndex:(
SCIndex)index;
285 - (void)setBool:(BOOL)value atIndex:(
SCIndex)index;
289 - (void)insertAtIndex:(
SCIndex)index objects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
290 - (void)insertCollection:(
id)collection atIndex:(
SCIndex)index;
291 - (void)insertAtIndexes:(NSIndexSet *)indexes objects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
292 - (void)insertCollection:(
id)collection atIndexes:(NSIndexSet *)indexes;
295 #pragma mark Удаление объектов
296 - (void)removeFirstObject;
297 - (void)removeLastObject;
298 - (void)removeObjectAtIndex:(
SCIndex)index;
299 - (void)removeObjectsAtIndexes:(NSIndexSet *)indexes;
300 - (void)removeObjectsInRange:(NSRange)range;
303 #pragma mark Замена объектов
304 - (void)replaceObjectAtIndex:(
SCIndex)index withObject:(
id)object;
305 - (void)replaceObjectAtIndex:(
SCIndex)index withByte:(
SCByte)value;
306 - (void)replaceObjectAtIndex:(
SCIndex)index withUByte:(
SCUByte)value;
307 - (void)replaceObjectAtIndex:(
SCIndex)index withShort:(
SCShort)value;
308 - (void)replaceObjectAtIndex:(
SCIndex)index withUShort:(
SCUShort)value;
311 - (void)replaceObjectAtIndex:(
SCIndex)index withLong:(
SCLong)value;
312 - (void)replaceObjectAtIndex:(
SCIndex)index withULong:(
SCULong)value;
313 - (void)replaceObjectAtIndex:(
SCIndex)index withChar:(
char)value;
314 - (void)replaceObjectAtIndex:(
SCIndex)index withUnichar:(unichar)value;
315 - (void)replaceObjectAtIndex:(
SCIndex)index withCharString:(const
char *)string;
316 - (void)replaceObjectAtIndex:(
SCIndex)index withBool:(BOOL)value;
317 - (void)replaceObjectAtIndex:(
SCIndex)index withFloat:(
SCFloat)value;
318 - (void)replaceObjectAtIndex:(
SCIndex)index withDouble:(
SCDouble)value;
320 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withObjects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
321 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withCollection:(
id)collection;
322 - (void)replaceObjectsInRange:(NSRange)range withObjects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
323 - (void)replaceObjectsInRange:(NSRange)range withCollection:(
id)collection;
326 #pragma mark Перемещение объектов
327 - (void)exchangeObjectAtIndex:(
SCIndex)index withObjectAtIndex:(
SCIndex)destination;
328 - (void)moveObjectAtIndex:(
SCIndex)index toIndex:(
SCIndex)destination;
332 #pragma mark Доступ к объектам
335 - (NSString *)firstString;
336 - (NSNumber *)firstNumber;
338 - (NSString *)lastString;
339 - (NSNumber *)lastNumber;
340 - (id)objectAtIndex:(
SCIndex)index;
341 - (NSString *)stringAtIndex:(
SCIndex)index;
342 - (NSNumber *)numberAtIndex:(
SCIndex)index;
343 - (
SCArray *)objectsAtIndexes:(NSIndexSet *)indexes;
347 #pragma mark Поиск объектов
348 - (
SCIndex)indexOfObject:(
id)object;
357 - (
SCIndex)indexOfChar:(
char)value;
358 - (
SCIndex)indexOfUnichar:(unichar)value;
359 - (
SCIndex)indexOfCharString:(const
char *)string;
360 - (
SCIndex)indexOfBool:(BOOL)value;
366 #pragma mark Комбинирование и рекомбинирование упорядоченных множеств
367 - (void)unionOrderedSet:(
id)orderedSet;
368 - (void)unionSet:(
id)set;
369 - (void)minusOrderedSet:(
id)set;
370 - (void)minusSet:(
id)set;
371 - (void)intersectOrderedSet:(
id)orderedSet;
372 - (void)intersectSet:(
id)set;
Unordered set class.
Definition: SCSet.h:63
uint64_t SCULong
Definition: SCTypes.h:78
int16_t SCShort
Definition: SCTypes.h:42
SCULong SCIndex
Index data type.
Definition: SCTypes.h:240
int64_t SCLong
Definition: SCTypes.h:54
NSString * lastString
Definition: SCOrderedSet.h:148
SCOrderedSet * sortedOrderedSet
Definition: SCOrderedSet.h:97
int32_t SCInteger
Definition: SCTypes.h:48
uint32_t SCUInteger
Definition: SCTypes.h:72
Mutable indexed collection protocol.
Definition: SCMutableIndexedCollection.h:38
int8_t SCByte
Definition: SCTypes.h:36
NSString * firstString
Definition: SCOrderedSet.h:130
SCIndex indexOfLastObject
Definition: SCOrderedSet.h:173
Ordered set class.
Definition: SCOrderedSet.h:74
uint16_t SCUShort
Definition: SCTypes.h:66
uint8_t SCUByte
Definition: SCTypes.h:60
Abstract implementation of the protocol SCSorter.
Definition: SCSorter.h:37
NSNumber * lastNumber
Definition: SCOrderedSet.h:154
id firstObject
Definition: SCOrderedSet.h:124
Indexed collections protocol.
Definition: SCIndexedCollection.h:39
SCOrderedSet * reversedOrderedSet
Definition: SCOrderedSet.h:160
float_t SCFloat
Definition: SCTypes.h:84
SCArray * allObjects
Definition: SCOrderedSet.h:118
Abstract collections class.
Definition: SCCollection.h:94
id lastObject
Definition: SCOrderedSet.h:142
NSNumber * firstNumber
Definition: SCOrderedSet.h:136
Array class.
Definition: SCArray.h:77
double_t SCDouble
Definition: SCTypes.h:90
Abstract parent class of the stream classes hierarchy.
Definition: SCStream.h:242