Samond Classes Library 1.2.1-RELEASE build 181
SCOrderedSet.h
См. документацию.
1 //
2 // SCOrderedSet.h
3 // scl
4 //
5 // Created by Viacheslav Smolensky on 04.02.16.
6 // Copyright (c) 2007 - 2017 by Samond Development Corporation. All rights reserved.
7 //
8 
22 #import <scl/SCCollection.h>
23 #import <scl/SCSorter.h>
24 
25 #pragma mark -
26 #pragma mark Class Constants
27 
31 #define SCOrderedSetClass @"SCOrderedSet"
32 
33 #ifndef GNUSTEP
34 
74  NSMutableOrderedSet *fOrderedSet; // Internal data storage
75 }
76 
96 @property (nonatomic, assign, readonly, getter=sortedOrderedSet) SCOrderedSet *sortedOrderedSet;
97 
117 @property (nonatomic, retain, readonly, getter=allObjects) SCArray *allObjects;
118 
123 @property (nonatomic, retain, readonly, getter=firstObject) id firstObject;
124 
129 @property (nonatomic, retain, readonly, getter=lastObject) id lastObject;
130 
135 @property (nonatomic, retain, readonly, getter=reversedOrderedSet) SCOrderedSet *reversedOrderedSet;
136 
148 @property (nonatomic, assign, readonly, getter=indexOfLastObject) SCIndex indexOfLastObject;
149 
152 #pragma mark -
153 #pragma mark Creating Ordered Sets
154 + (instancetype)orderedSetWithCoder:(NSCoder *)coder;
155 + (instancetype)orderedSetWithContentsOfSerializedFile:(NSString *)path;
156 + (instancetype)orderedSetWithDataDictionary:(NSDictionary *)dictionary;
157 + (instancetype)orderedSetWithDataDictionaryFromFile:(NSString *)path;
158 + (instancetype)orderedSetWithStream:(SCStream *)stream;
159 + (instancetype)orderedSetWithFileStream:(NSString *)path;
160 
161 + (instancetype)orderedSetWithName:(NSString *)name;
162 + (instancetype)orderedSetWithObject:(id<SCCollectioning>)object;
163 + (instancetype)orderedSetWithObjects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
164 + (instancetype)orderedSetWithCollection:(id<SCCollection>)collection;
165 + (instancetype)orderedSetWithArray:(SCArray *)array;
166 + (instancetype)orderedSetWithSet:(SCSet *)set;
167 + (instancetype)orderedSetWithOrderedSet:(SCOrderedSet *)orderedSet;
168 + (instancetype)orderedSet;
169 
170 + (instancetype)orderedSetWithAscendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
171 + (instancetype)orderedSetWithDescendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
172 + (instancetype)orderedSetWithSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
173 + (instancetype)orderedSetWithAscendingSortedCollection:(id<SCCollection>)collection;
174 + (instancetype)orderedSetWithDescendingSortedCollection:(id<SCCollection>)collection;
175 + (instancetype)orderedSetWithSortedCollection:(id<SCCollection>)collection;
176 
177 #pragma mark -
178 #pragma mark Initializing Ordered Sets
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)initWithSet:(SCSet *)set;
185 - (instancetype)initWithOrderedSet:(SCOrderedSet *)orderedSet;
186 - (instancetype)init;
187 
188 - (instancetype)initWithAscendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
189 - (instancetype)initWithDescendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
190 - (instancetype)initWithSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
191 - (instancetype)initWithAscendingSortedCollection:(id<SCCollection>)collection;
192 - (instancetype)initWithDescendingSortedCollection:(id<SCCollection>)collection;
193 - (instancetype)initWithSortedCollection:(id<SCCollection>)collection;
194 
195 #pragma mark -
196 #pragma mark Copying Ordered Sets
197 - (void)setSet:(SCSet *)set;
198 - (void)setOrderedSet:(SCOrderedSet *)orderedSet;
199 - (void)setAscendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
200 - (void)setDescendingSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
201 - (void)setSortedCollection:(id<SCCollection>)collection sorter:(id<SCSorter>)sorter;
202 - (void)setAscendingSortedCollection:(id<SCCollection>)collection;
203 - (void)setDescendingSortedCollection:(id<SCCollection>)collection;
204 - (void)setSortedCollection:(id<SCCollection>)collection;
205 
206 #pragma mark -
207 #pragma mark Comparing Ordered Sets
208 - (BOOL)isSubsetOfOrderedSet:(id<SCCollection>)orderedSet;
209 - (BOOL)isSubsetOfSet:(id<SCCollection>)set;
210 - (BOOL)intersectsOrderedSet:(id<SCCollection>)orderedSet;
211 - (BOOL)intersectsSet:(id<SCCollection>)set;
212 - (BOOL)isEqualToOrderedSet:(id<SCCollection>)orderedSet;
213 - (BOOL)isEqualToContentsOfOrderedSet:(SCOrderedSet *)orderedSet;
214 
215 #pragma mark -
216 #pragma mark Sorting Ordered Sets
217 - (void)sortAscendingWithSorter:(id<SCSorter>)sorter;
218 - (void)sortDescendingWithSorter:(id<SCSorter>)sorter;
219 - (void)sortWithSorter:(id<SCSorter>)sorter;
220 - (void)sortAscending;
221 - (void)sortDescending;
222 - (void)sort;
223 - (SCOrderedSet *)ascendingSortedOrderedSetWithSorter:(id<SCSorter>)sorter;
224 - (SCOrderedSet *)descendingSortedOrderedSetWithSorter:(id<SCSorter>)sorter;
225 - (SCOrderedSet *)sortedOrderedSetWithSorter:(id<SCSorter>)sorter;
226 - (SCOrderedSet *)ascendingSortedOrderedSet;
227 - (SCOrderedSet *)descendingSortedOrderedSet;
228 - (SCOrderedSet *)sortedOrderedSet;
229 
230 #pragma mark -
231 #pragma mark Adding Objects
232 - (void)insertObject:(id<SCCollectioning>)object atIndex:(SCIndex)index;
233 - (void)insertAtIndex:(SCIndex)index objects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
234 - (void)insertCollection:(id<SCCollection>)collection atIndex:(SCIndex)index;
235 - (void)insertAtIndexes:(NSIndexSet *)indexes objects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
236 - (void)insertCollection:(id<SCCollection>)collection atIndexes:(NSIndexSet *)indexes;
237 - (void)setObject:(id<SCCollectioning>)object atIndex:(SCIndex)index;
238 
239 #pragma mark -
240 #pragma mark Removing Objects
241 - (void)removeFirstObject;
242 - (void)removeLastObject;
243 - (void)removeObjectAtIndex:(SCIndex)index;
244 - (void)removeObjectsAtIndexes:(NSIndexSet *)indexes;
245 - (void)removeObjectsInRange:(NSRange)range;
246 
247 #pragma mark -
248 #pragma mark Replacing Objects
249 - (void)replaceObjectAtIndex:(SCIndex)index withObject:(id<SCCollectioning>)object;
250 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes
251  withObjects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
252 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withCollection:(id<SCCollection>)collection;
253 - (void)replaceObjectsInRange:(NSRange)range withObjects:(id<SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
254 - (void)replaceObjectsInRange:(NSRange)range withCollection:(id<SCCollection>)collection;
255 
256 #pragma mark -
257 #pragma mark Moving Objects
258 - (void)exchangeObjectAtIndex:(SCIndex)index withObjectAtIndex:(SCIndex)destination;
259 - (void)moveObjectAtIndex:(SCIndex)index toIndex:(SCIndex)destination;
260 - (void)reverse;
261 
262 #pragma mark -
263 #pragma mark Querying an Ordered Set
264 - (SCArray *)allObjects;
265 - (id)firstObject;
266 - (id)lastObject;
267 - (id)objectAtIndex:(SCIndex)index;
268 - (SCArray *)objectsAtIndexes:(NSIndexSet *)indexes;
269 - (SCOrderedSet *)reversedOrderedSet;
270 
271 #pragma mark -
272 #pragma mark Finding Objects in an Ordered Set
273 - (SCIndex)indexOfObject:(id<SCCollectioning>)object;
274 - (SCIndex)indexOfLastObject;
275 
276 #pragma mark -
277 #pragma mark Combining and Recombining Ordered Sets
278 - (void)unionOrderedSet:(id<SCCollection>)orderedSet;
279 - (void)unionSet:(id<SCCollection>)set;
280 - (void)minusOrderedSet:(id<SCCollection>)set;
281 - (void)minusSet:(id<SCCollection>)set;
282 - (void)intersectOrderedSet:(id<SCCollection>)orderedSet;
283 - (void)intersectSet:(id<SCCollection>)set;
284 
285 @end
286 
287 #endif
Класс неупорядоченного множества объектов
Definition: SCSet.h:65
SCOrderedSet * sortedOrderedSet
Definition: SCOrderedSet.h:96
Протокол классов изменяемых индексированных коллекций
Definition: SCCollectionProtocols.h:1029
SCIndex indexOfLastObject
Definition: SCOrderedSet.h:148
Класс упорядоченного множества объектов
Definition: SCOrderedSet.h:73
Класс абстрактного алгоритма сортировки данных
Definition: SCSorter.h:130
id firstObject
Definition: SCOrderedSet.h:123
Протокол классов индексированных коллекций
Definition: SCCollectionProtocols.h:939
SCOrderedSet * reversedOrderedSet
Definition: SCOrderedSet.h:135
SCArray * allObjects
Definition: SCOrderedSet.h:117
NSUInteger SCIndex
Definition: SCTypes.h:238
Протокол взаимодействия с механизмом коллекций
Definition: SCCollectioning.h:80
Абстрактный класс механизма коллекций библиотеки
Definition: SCCollection.h:94
id lastObject
Definition: SCOrderedSet.h:129
Класс массивов объектов
Definition: SCArray.h:75
Абстрактный класс потоков библиотеки
Definition: SCStream.h:242