22 #import <Foundation/Foundation.h>
23 #if defined(GNUSTEP) && !defined(NS_ORDERED_SER_CLASS)
24 #import <scl/NSMutableOrderedSet.h>
32 #pragma mark Class Constants
42 #define SCOrderedSetClass @"SCOrderedSet"
84 NSMutableOrderedSet *_orderedSet;
112 @property (nonatomic, readonly, assign)
SCOrderedSet *ascendingSortedOrderedSet;
118 @property (nonatomic, readonly, assign)
SCOrderedSet *descendingSortedOrderedSet;
127 @property (nonatomic, readonly, assign)
SCOrderedSet *sortedOrderedSet;
148 @property (nonatomic, readonly, assign)
SCArray *allObjects;
154 @property (nonatomic, readonly, assign)
id firstObject;
160 @property (nonatomic, readonly, assign)
id lastObject;
166 @property (nonatomic, readonly, assign)
SCOrderedSet *reversedOrderedSet;
179 @property (nonatomic, readonly, assign)
SCIndex indexOfLastObject;
184 #pragma mark Creating Ordered Sets
185 + (instancetype)orderedSetWithCoder:(NSCoder *)coder;
186 + (instancetype)orderedSetWithContentsOfSerializedFile:(NSString *)path;
187 + (instancetype)orderedSetWithDataDictionary:(NSDictionary *)dictionary;
188 + (instancetype)orderedSetWithDataDictionaryFromFile:(NSString *)path;
189 + (instancetype)orderedSetWithStream:(
SCStream *)stream;
190 + (instancetype)orderedSetWithFileStream:(NSString *)path;
191 + (instancetype)orderedSetWithData:(NSData *)data;
192 + (instancetype)orderedSetWithContentsOfFile:(NSString *)path;
193 + (instancetype)orderedSetWithContentsOfURL:(NSURL *)url;
194 + (instancetype)orderedSetWithContentsOfURLString:(NSString *)urlString;
196 + (instancetype)orderedSetWithName:(NSString *)name;
198 + (instancetype)orderedSetWithObjects:(
id<
SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
199 + (instancetype)orderedSetWithCollection:(
id<
SCCollection>)collection;
200 + (instancetype)orderedSetWithArray:(
SCArray *)array;
201 + (instancetype)orderedSetWithSet:(
SCSet *)set;
202 + (instancetype)orderedSetWithOrderedSet:(
SCOrderedSet *)orderedSet;
203 + (instancetype)orderedSet;
205 + (instancetype)orderedSetWithAscendingSortedCollection:(
id<
SCCollection>)collection sorter:(
id<
SCSorter>)sorter;
206 + (instancetype)orderedSetWithDescendingSortedCollection:(
id<
SCCollection>)collection sorter:(
id<
SCSorter>)sorter;
207 + (instancetype)orderedSetWithSortedCollection:(
id<
SCCollection>)collection sorter:(
id<
SCSorter>)sorter;
208 + (instancetype)orderedSetWithAscendingSortedCollection:(
id<
SCCollection>)collection;
209 + (instancetype)orderedSetWithDescendingSortedCollection:(
id<
SCCollection>)collection;
210 + (instancetype)orderedSetWithSortedCollection:(
id<
SCCollection>)collection;
213 #pragma mark Initializing Ordered Sets
214 - (instancetype)initWithName:(NSString *)name;
216 - (instancetype)initWithObjects:(
id<
SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
217 - (instancetype)initWithCollection:(
id<
SCCollection>)collection;
218 - (instancetype)initWithArray:(
SCArray *)array;
219 - (instancetype)initWithSet:(
SCSet *)set;
220 - (instancetype)initWithOrderedSet:(
SCOrderedSet *)orderedSet;
221 - (instancetype)init;
223 - (instancetype)initWithAscendingSortedCollection:(
id<
SCCollection>)collection sorter:(
id<
SCSorter>)sorter;
224 - (instancetype)initWithDescendingSortedCollection:(
id<
SCCollection>)collection sorter:(
id<
SCSorter>)sorter;
225 - (instancetype)initWithSortedCollection:(
id<
SCCollection>)collection sorter:(
id<
SCSorter>)sorter;
226 - (instancetype)initWithAscendingSortedCollection:(
id<
SCCollection>)collection;
227 - (instancetype)initWithDescendingSortedCollection:(
id<
SCCollection>)collection;
228 - (instancetype)initWithSortedCollection:(
id<
SCCollection>)collection;
231 #pragma mark Copying Ordered Sets
232 - (void)setSet:(
SCSet *)set;
234 - (void)setArray:(
SCArray *)array;
238 - (void)setAscendingSortedCollection:(
id<
SCCollection>)collection;
239 - (void)setDescendingSortedCollection:(
id<
SCCollection>)collection;
240 - (void)setSortedCollection:(
id<
SCCollection>)collection;
243 #pragma mark Comparing Ordered Sets
244 - (BOOL)isSubsetOfOrderedSet:(
id<
SCCollection>)orderedSet;
246 - (BOOL)intersectsOrderedSet:(
id<
SCCollection>)orderedSet;
249 - (BOOL)isEqualToSet:(
SCSet *)set;
250 - (BOOL)isEqualToArray:(
SCArray *)array;
253 #pragma mark Deriving New Ordered Sets
265 #pragma mark Sorting Ordered Sets
266 - (void)sortAscendingWithSorter:(
id<
SCSorter>)sorter;
267 - (void)sortDescendingWithSorter:(
id<
SCSorter>)sorter;
268 - (void)sortWithSorter:(
id<
SCSorter>)sorter;
269 - (void)sortAscending;
270 - (void)sortDescending;
277 #pragma mark Adding Objects
279 - (void)insertAtIndex:(
SCIndex)index objects:(
id<
SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
281 - (void)insertAtIndexes:(NSIndexSet *)indexes objects:(
id<
SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
282 - (void)insertCollection:(
id<
SCCollection>)collection atIndexes:(NSIndexSet *)indexes;
284 - (void)addObjectsFromArray:(
SCArray *)array;
285 - (void)addArray:(
SCArray *)array;
286 - (void)addObjectsFromSet:(
SCSet *)set;
287 - (void)addSet:(
SCSet *)set;
288 - (void)addObjectsFromOrderedSet:(
SCOrderedSet *)orderedSet;
292 #pragma mark Removing Objects
293 - (void)removeFirstObject;
294 - (void)removeLastObject;
295 - (void)removeObjectAtIndex:(
SCIndex)index;
296 - (void)removeObjectsAtIndexes:(NSIndexSet *)indexes;
297 - (void)removeObjectsInRange:(NSRange)range;
300 #pragma mark Replacing Objects
302 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes
303 withObjects:(
id<
SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
304 - (void)replaceObjectsAtIndexes:(NSIndexSet *)indexes withCollection:(
id<
SCCollection>)collection;
305 - (void)replaceObjectsInRange:(NSRange)range withObjects:(
id<
SCCollectioning>)object, ... NS_REQUIRES_NIL_TERMINATION;
306 - (void)replaceObjectsInRange:(NSRange)range withCollection:(
id<
SCCollection>)collection;
310 #pragma mark Moving Objects
311 - (void)exchangeObjectAtIndex:(
SCIndex)index withObjectAtIndex:(
SCIndex)destination;
312 - (void)moveObjectAtIndex:(
SCIndex)index toIndex:(
SCIndex)destination;
316 #pragma mark Querying an Ordered Set
317 - (id)objectAtIndex:(
SCIndex)index;
318 - (
SCArray *)objectsAtIndexes:(NSIndexSet *)indexes;
319 - (id)objectAtIndexedSubscript:(
SCIndex)index;
322 #pragma mark Finding Objects in an Ordered Set
326 #pragma mark Combining and Recombining Ordered Sets
331 - (void)intersectOrderedSet:(
id<
SCCollection>)orderedSet;
Unordered set class.
Definition: SCSet.h:72
Mutable indexed collection protocol.
Definition: SCCollectionProtocols.h:887
Caregory NSArray(SCArray) header file.
Ordered set class.
Definition: SCOrderedSet.h:83
Abstract implementation of the protocol SCSorter.
Definition: SCSorter.h:138
Indexed collections protocol.
Definition: SCCollectionProtocols.h:793
Protocol and class SCSorter header file.
Collections communications protocol.
Definition: SCCollectioning.h:79
Category NSDictionary(SCDictionary) header file.
Abstract collections class.
Definition: SCCollection.h:98
Class SCCollection header file.
Array class.
Definition: SCArray.h:84
NSUInteger SCIndex
Definition: SCCollectionProtocols.h:53
Abstract parent class of the stream classes hierarchy.
Definition: SCStream.h:224