22 #import <scl/SCCollection.h>
23 #import <scl/SCSorter.h>
24 #import <scl/SCIndexedCollection.h>
25 #import <scl/SCMutableIndexedCollection.h>
28 #pragma mark Константы класса
33 #define SCArrayClass @"SCArray"
78 NSMutableArray *fArray;
133 @property (nonatomic, retain, readonly, getter=
firstObject)
id firstObject;
139 @property (nonatomic, retain, readonly, getter=
firstString) NSString *firstString;
145 @property (nonatomic, retain, readonly, getter=
firstNumber) NSNumber *firstNumber;
151 @property (nonatomic, retain, readonly, getter=
lastObject)
id lastObject;
157 @property (nonatomic, retain, readonly, getter=
lastString) NSString *lastString;
163 @property (nonatomic, retain, readonly, getter=
lastNumber) NSNumber *lastNumber;
181 #pragma mark Создание массивов
182 + (
SCArray *)arrayWithCoder:(NSCoder *)coder;
183 + (
SCArray *)arrayWithContentsOfSerializedFile:(NSString *)path;
184 + (
SCArray *)arrayWithDataDictionary:(NSDictionary *)dictionary;
185 + (
SCArray *)arrayWithDataDictionaryFromFile:(NSString *)path;
187 + (
SCArray *)arrayWithFileStream:(NSString *)path;
189 + (
SCArray *)arrayWithName:(NSString *)name;
190 + (
SCArray *)arrayWithObject:(
id)object;
191 + (
SCArray *)arrayWithObjects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
192 + (
SCArray *)arrayWithCollection:(
id)collection;
196 + (
SCArray *)arrayWithAscendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
197 + (
SCArray *)arrayWithDescendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
198 + (
SCArray *)arrayWithSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
199 + (
SCArray *)arrayWithAscendingSortedCollection:(
id)collection;
200 + (
SCArray *)arrayWithDescendingSortedCollection:(
id)collection;
201 + (
SCArray *)arrayWithSortedCollection:(
id)collection;
204 #pragma mark Инициализация массивов
205 - (id)initWithName:(NSString *)name;
206 - (id)initWithObject:(
id)object;
207 - (id)initWithObjects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
208 - (id)initWithCollection:(
id)collection;
209 - (id)initWithArray:(
SCArray *)array;
212 - (id)initWithAscendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
213 - (id)initWithDescendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
214 - (id)initWithSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
215 - (id)initWithAscendingSortedCollection:(
id)collection;
216 - (id)initWithDescendingSortedCollection:(
id)collection;
217 - (id)initWithSortedCollection:(
id)collection;
220 #pragma mark Копирование массивов
221 - (void)setArray:(
SCArray *)array;
222 - (void)setAscendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
223 - (void)setDescendingSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
224 - (void)setSortedCollection:(
id)collection sorter:(
id<
SCSorter>)sorter;
225 - (void)setAscendingSortedCollection:(
id)collection;
226 - (void)setDescendingSortedCollection:(
id)collection;
227 - (void)setSortedCollection:(
id)collection;
230 #pragma mark Сравнение массивов
231 - (BOOL)isEqualToArray:(
SCArray *)array;
232 - (BOOL)isEqualToContentsOfArray:(
SCArray *)array;
235 #pragma mark Сортировка массивов
236 - (void)sortAscendingWithSorter:(
id<
SCSorter>)sorter;
237 - (void)sortDescendingWithSorter:(
id<
SCSorter>)sorter;
238 - (void)sortWithSorter:(
id<
SCSorter>)sorter;
239 - (void)sortAscending;
240 - (void)sortDescending;
245 - (
SCArray *)ascendingSortedArray;
246 - (
SCArray *)descendingSortedArray;
250 #pragma mark Добавление объектов
251 - (void)insertObject:(
id)object atIndex:(
SCIndex)index;
260 - (void)insertChar:(
char)value atIndex:(
SCIndex)index;
261 - (void)insertUnichar:(unichar)value atIndex:(
SCIndex)index;
262 - (void)insertCharString:(const
char *)string atIndex:(
SCIndex)index;
263 - (void)insertBool:(BOOL)value atIndex:(
SCIndex)index;
267 - (void)setObject:(
id)object atIndex:(
SCIndex)index;
276 - (void)setChar:(
char)value atIndex:(
SCIndex)index;
277 - (void)setUnichar:(unichar)value atIndex:(
SCIndex)index;
278 - (void)setCharString:(const
char *)string atIndex:(
SCIndex)index;
279 - (void)setBool:(BOOL)value atIndex:(
SCIndex)index;
283 - (void)insertAtIndex:(
SCIndex)index objects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
284 - (void)insertCollection:(
id)collection atIndex:(
SCIndex)index;
285 - (void)insertAtIndexes:(NSIndexSet *)indexes objects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
286 - (void)insertCollection:(
id)collection atIndexes:(NSIndexSet *)indexes;
289 #pragma mark Удаление объектов
290 - (void)removeFirstObject;
291 - (void)removeLastObject;
292 - (void)removeObjectAtIndex:(
SCIndex)index;
293 - (void)removeObjectsAtIndexes:(NSIndexSet *)indexes;
294 - (void)removeObjectsInRange:(NSRange)range;
297 #pragma mark Замена объектов
298 - (void)replaceObjectAtIndex:(
SCIndex)index withObject:(
id)object;
299 - (void)replaceObjectAtIndex:(
SCIndex)index withByte:(
SCByte)value;
300 - (void)replaceObjectAtIndex:(
SCIndex)index withUByte:(
SCUByte)value;
301 - (void)replaceObjectAtIndex:(
SCIndex)index withShort:(
SCShort)value;
302 - (void)replaceObjectAtIndex:(
SCIndex)index withUShort:(
SCUShort)value;
305 - (void)replaceObjectAtIndex:(
SCIndex)index withLong:(
SCLong)value;
306 - (void)replaceObjectAtIndex:(
SCIndex)index withULong:(
SCULong)value;
307 - (void)replaceObjectAtIndex:(
SCIndex)index withChar:(
char)value;
308 - (void)replaceObjectAtIndex:(
SCIndex)index withUnichar:(unichar)value;
309 - (void)replaceObjectAtIndex:(
SCIndex)index withCharString:(const
char *)string;
310 - (void)replaceObjectAtIndex:(
SCIndex)index withBool:(BOOL)value;
311 - (void)replaceObjectAtIndex:(
SCIndex)index withFloat:(
SCFloat)value;
312 - (void)replaceObjectAtIndex:(
SCIndex)index withDouble:(
SCDouble)value;
314 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withObjects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
315 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withCollection:(
id)collection;
316 - (void)replaceObjectsInRange:(NSRange)range withObjects:(
id)object, ... NS_REQUIRES_NIL_TERMINATION;
317 - (void)replaceObjectsInRange:(NSRange)range withCollection:(
id)collection;
320 #pragma mark Копирование и перемещение объектов
321 - (void)exchangeObjectAtIndex:(
SCIndex)index withObjectAtIndex:(
SCIndex)destination;
322 - (void)duplicateObjectAtIndex:(
SCIndex)index;
323 - (void)duplicateObjectsInRange:(NSRange)range;
324 - (void)duplicateAllObjects;
327 - (void)copyObjectAtIndex:(
SCIndex)index toIndex:(
SCIndex)destination;
328 - (void)copyObjectsInRange:(NSRange)range toIndex:(
SCIndex)destination;
329 - (void)moveObjectAtIndex:(
SCIndex)index toIndex:(
SCIndex)destination;
330 - (void)moveObjectsInRange:(NSRange)range toIndex:(
SCIndex)destination;
336 #pragma mark Доступ к объектам
338 - (NSString *)firstString;
339 - (NSNumber *)firstNumber;
341 - (NSString *)lastString;
342 - (NSNumber *)lastNumber;
343 - (id)objectAtIndex:(
SCIndex)index;
344 - (NSString *)stringAtIndex:(
SCIndex)index;
345 - (NSNumber *)numberAtIndex:(
SCIndex)index;
346 - (
SCArray *)objectsAtIndexes:(NSIndexSet *)indexes;
347 - (
SCArray *)objectsInRange:(NSRange)range;
350 #pragma mark Поиск объектов
351 - (
SCIndex)indexOfObject:(
id)object;
360 - (
SCIndex)indexOfChar:(
char)value;
361 - (
SCIndex)indexOfUnichar:(unichar)value;
362 - (
SCIndex)indexOfCharString:(const
char *)string;
363 - (
SCIndex)indexOfBool:(BOOL)value;
367 - (
SCIndex)indexOfObject:(
id)object inRange:(NSRange)range;
376 - (
SCIndex)indexOfChar:(
char)value inRange:(NSRange)range;
377 - (
SCIndex)indexOfUnichar:(unichar)value inRange:(NSRange)range;
378 - (
SCIndex)indexOfCharString:(const
char *)string inRange:(NSRange)range;
379 - (
SCIndex)indexOfBool:(BOOL)value inRange:(NSRange)range;
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
int32_t SCInteger
Definition: SCTypes.h:48
NSNumber * firstNumber
Definition: SCArray.h:145
uint32_t SCUInteger
Definition: SCTypes.h:72
Mutable indexed collection protocol.
Definition: SCMutableIndexedCollection.h:38
int8_t SCByte
Definition: SCTypes.h:36
uint16_t SCUShort
Definition: SCTypes.h:66
uint8_t SCUByte
Definition: SCTypes.h:60
Abstract implementation of the protocol SCSorter.
Definition: SCSorter.h:37
SCIndex indexOfLastObject
Definition: SCArray.h:176
Indexed collections protocol.
Definition: SCIndexedCollection.h:39
NSString * lastString
Definition: SCArray.h:157
float_t SCFloat
Definition: SCTypes.h:84
id firstObject
Definition: SCArray.h:133
Abstract collections class.
Definition: SCCollection.h:94
NSString * firstString
Definition: SCArray.h:139
SCArray * sortedArray
Definition: SCArray.h:100
SCArray * reversedArray
Definition: SCArray.h:120
NSNumber * lastNumber
Definition: SCArray.h:163
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
id lastObject
Definition: SCArray.h:151