Samond Classes Library 1.2.1-RELEASE build 181
SCArray.h
См. документацию.
1 //
2 // SCArray.h
3 // scl
4 //
5 // Created by Viacheslav Smolensky on 13.04.12.
6 // Copyright (c) 2007 - 2017 by Samond Development Corporation. All rights reserved.
7 //
8 
23 #import <scl/SCCollection.h>
24 #import <scl/SCSorter.h>
25 
26 #pragma mark -
27 #pragma mark Class Constants
28 
32 #define SCArrayClass @"SCArray"
33 
34 
76  NSMutableArray *fArray; // Internal data storage
77 }
78 
98 @property (nonatomic, retain, readonly, getter=sortedArray) SCArray *sortedArray;
99 // Отсортированный по возрастанию массив (<i><b>только для чтения</b></i>)
100 
118 @property (nonatomic, retain, readonly, getter=reversedArray) SCArray *reversedArray;
119 
131 @property (nonatomic, retain, readonly, getter=firstObject) id firstObject;
132 
137 @property (nonatomic, retain, readonly, getter=lastObject) id lastObject;
138 
150 @property (nonatomic, assign, readonly, getter=indexOfLastObject) SCIndex indexOfLastObject;
151 
154 #pragma mark -
155 #pragma mark Creating Arrays
156 + (instancetype)arrayWithCoder:(NSCoder *)coder;
157 + (instancetype)arrayWithContentsOfSerializedFile:(NSString *)path;
158 + (instancetype)arrayWithDataDictionary:(NSDictionary *)dictionary;
159 + (instancetype)arrayWithDataDictionaryFromFile:(NSString *)path;
160 + (instancetype)arrayWithStream:(SCStream *)stream;
161 + (instancetype)arrayWithFileStream:(NSString *)path;
162 
163 + (instancetype)arrayWithName:(NSString *)name;
164 + (instancetype)arrayWithObject:(id<SCCollectioning>)object;
165 + (instancetype)arrayWithObjects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
166 + (instancetype)arrayWithCollection:(id<SCCollection>)collection;
167 + (instancetype)arrayWithArray:(SCArray *)array;
168 + (instancetype)array;
169 
170 + (instancetype)arrayWithAscendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
171 + (instancetype)arrayWithDescendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
172 + (instancetype)arrayWithSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
173 + (instancetype)arrayWithAscendingSortedCollection:(id<SCCollection>)collection;
174 + (instancetype)arrayWithDescendingSortedCollection:(id<SCCollection>)collection;
175 + (instancetype)arrayWithSortedCollection:(id<SCCollection>)collection;
176 
177 #pragma mark -
178 #pragma mark Initializing Arrays
179 - (instancetype)initWithName:(NSString *)name;
180 - (instancetype)initWithObject:(id<SCCollectioning>)object;
181 - (instancetype)initWithObjects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
182 - (instancetype)initWithCollection:(id<SCCollection>)collection;
183 - (instancetype)initWithArray:(SCArray *)array;
184 - (instancetype)init;
185 
186 - (instancetype)initWithAscendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
187 - (instancetype)initWithDescendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
188 - (instancetype)initWithSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
189 - (instancetype)initWithAscendingSortedCollection:(id<SCCollection>)collection;
190 - (instancetype)initWithDescendingSortedCollection:(id<SCCollection>)collection;
191 - (instancetype)initWithSortedCollection:(id<SCCollection>)collection;
192 
193 #pragma mark -
194 #pragma mark Copying Arrays
195 - (void)setArray:(SCArray *)array;
196 - (void)setAscendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
197 - (void)setDescendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
198 - (void)setSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
199 - (void)setAscendingSortedCollection:(id<SCCollection>)collection;
200 - (void)setDescendingSortedCollection:(id<SCCollection>)collection;
201 - (void)setSortedCollection:(id<SCCollection>)collection;
202 
203 #pragma mark -
204 #pragma mark Comparing Arrays
205 - (BOOL)isEqualToArray:(SCArray *)array;
206 - (BOOL)isEqualToContentsOfArray:(SCArray *)array;
207 
208 #pragma mark -
209 #pragma mark Sorting Arrays
210 - (void)sortAscendingWithSorter:(id<SCSorter>)sorter;
211 - (void)sortDescendingWithSorter:(id<SCSorter>)sorter;
212 - (void)sortWithSorter:(id<SCSorter>)sorter;
213 - (void)sortAscending;
214 - (void)sortDescending;
215 - (void)sort;
216 - (SCArray *)ascendingSortedArrayWithSorter:(id<SCSorter>)sorter;
217 - (SCArray *)descendingSortedArrayWithSorter:(id<SCSorter>)sorter;
218 - (SCArray *)sortedArrayWithSorter:(id<SCSorter>)sorter;
219 - (SCArray *)ascendingSortedArray;
220 - (SCArray *)descendingSortedArray;
221 - (SCArray *)sortedArray;
222 
223 #pragma mark -
224 #pragma mark Adding Objects
225 - (void)insertObject:(id<SCCollectioning>)object atIndex:(SCIndex)index;
226 - (void)insertAtIndex:(SCIndex)index objects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
227 - (void)insertCollection:(id<SCCollection>)collection atIndex:(SCIndex)index;
228 - (void)insertAtIndexes:(NSIndexSet *)indexes objects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
229 - (void)insertCollection:(id<SCCollection>)collection atIndexes:(NSIndexSet *)indexes;
230 - (void)setObject:(id<SCCollectioning>)object atIndex:(SCIndex)index;
231 
232 #pragma mark -
233 #pragma mark Removing Objects
234 - (void)removeFirstObject;
235 - (void)removeLastObject;
236 - (void)removeObjectAtIndex:(SCIndex)index;
237 - (void)removeObjectsAtIndexes:(NSIndexSet *)indexes;
238 - (void)removeObjectsInRange:(NSRange)range;
239 
240 #pragma mark -
241 #pragma mark Replacing Objects
242 - (void)replaceObjectAtIndex:(SCIndex)index withObject:(id<SCCollectioning>)object;
243 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes
244  withObjects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
245 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withCollection:(id<SCCollection>)collection;
246 - (void)replaceObjectsInRange:(NSRange)range withObjects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
247 - (void)replaceObjectsInRange:(NSRange)range withCollection:(id<SCCollection>)collection;
248 
249 #pragma mark -
250 #pragma mark Copying and Moving Objects
251 - (void)exchangeObjectAtIndex:(SCIndex)index withObjectAtIndex:(SCIndex)destination;
252 - (void)duplicateObjectAtIndex:(SCIndex)index;
253 - (void)duplicateObjectsInRange:(NSRange)range;
254 - (void)duplicateAllObjects;
255 - (void)duplicate;
256 
257 - (void)copyObjectAtIndex:(SCIndex)index toIndex:(SCIndex)destination;
258 - (void)copyObjectsInRange:(NSRange)range toIndex:(SCIndex)destination;
259 - (void)moveObjectAtIndex:(SCIndex)index toIndex:(SCIndex)destination;
260 - (void)moveObjectsInRange:(NSRange)range toIndex:(SCIndex)destination;
261 
262 - (void)reverse;
263 - (SCArray *)reversedArray;
264 
265 #pragma mark -
266 #pragma mark Querying an Array
267 - (id)firstObject;
268 - (id)lastObject;
269 - (id)objectAtIndex:(SCIndex)index;
270 - (SCArray *)objectsAtIndexes:(NSIndexSet *)indexes;
271 - (SCArray *)objectsInRange:(NSRange)range;
272 
273 #pragma mark -
274 #pragma mark Finding Objects in an Array
275 - (SCIndex)indexOfObject:(id<SCCollectioning>)object;
276 - (SCIndex)indexOfObject:(id<SCCollectioning>)object inRange:(NSRange)range;
277 - (SCIndex)indexOfLastObject;
278 
279 @end
Протокол классов изменяемых индексированных коллекций
Definition: SCCollectionProtocols.h:1029
Класс абстрактного алгоритма сортировки данных
Definition: SCSorter.h:130
SCIndex indexOfLastObject
Definition: SCArray.h:150
Протокол классов индексированных коллекций
Definition: SCCollectionProtocols.h:939
NSUInteger SCIndex
Definition: SCTypes.h:238
Протокол взаимодействия с механизмом коллекций
Definition: SCCollectioning.h:80
id firstObject
Definition: SCArray.h:131
Абстрактный класс механизма коллекций библиотеки
Definition: SCCollection.h:94
SCArray * sortedArray
Definition: SCArray.h:98
SCArray * reversedArray
Definition: SCArray.h:118
Класс массивов объектов
Definition: SCArray.h:75
Абстрактный класс потоков библиотеки
Definition: SCStream.h:242
id lastObject
Definition: SCArray.h:137