Samond Classes Library 1.2.6-STABLE build 219
|
Queue of objects class. More...
#import <SCQueue.h>
Creating Queues | |
(instancetype) | + queueWithCoder: |
(instancetype) | + queueWithContentsOfSerializedFile: |
(instancetype) | + queueWithDataDictionary: |
(instancetype) | + queueWithDataDictionaryFromFile: |
(instancetype) | + queueWithStream: |
(instancetype) | + queueWithFileStream: |
(instancetype) | + queueWithData: |
(instancetype) | + queueWithContentsOfFile: |
(instancetype) | + queueWithContentsOfURL: |
(instancetype) | + queueWithContentsOfURLString: |
(instancetype) | + queueWithName: |
(instancetype) | + queueWithObject: |
(instancetype) | + queueWithObjects: |
(instancetype) | + queueWithCollection: |
(instancetype) | + queueWithArray: |
(instancetype) | + queueWithQueue: |
(instancetype) | + queue |
Initializing Queues | |
(instancetype) | - initWithName: |
(instancetype) | - initWithObject: |
(instancetype) | - initWithObjects: |
(instancetype) | - initWithCollection: |
(instancetype) | - initWithArray: |
(instancetype) | - initWithQueue: |
(instancetype) | - init |
Copying Queues | |
(void) | - setQueue: |
Comparing Queues | |
(BOOL) | - isEqualToQueue: |
Deriving New Queues | |
(SCQueue *) | - queueByAddingObject: |
(SCQueue *) | - queueByAddingObjects: |
(SCQueue *) | - queueByAddingCollection: |
(SCQueue *) | - queueByAddingObjectsFromArray: |
(SCQueue *) | - queueByAddingArray: |
(SCQueue *) | - queueByAddingObjectsFromQueue: |
(SCQueue *) | - queueByAddingQueue: |
Adding Objects | |
(void) | - addObjectsFromArray: |
(void) | - addArray: |
(void) | - addObjectsFromQueue: |
(void) | - addQueue: |
Getting Objects | |
(id) | - getObject |
Removing Objects | |
(void) | - removeFirstObject |
(void) | - removeLastObject |
Copying Objects | |
(void) | - duplicateFirstObject |
(void) | - duplicateLastObject |
Querying a Queue | |
id | firstObject |
Queue of objects class.
Queue is a collection in which to objects in collection are kept in order and the principal (or only) operations on the collection are the addition of objects to the rear terminal position, known as enqueue, and removal of objects from the front terminal position, known as desqueue.
This makes the queue a First-In-First-Out (FIFO) collection. In queue, the first object added to the queue will be the first one to be removed. This is equivalent to the requirement that once a new object is added, all objects that were added before have to be removed before the new object can be removed.
Often a peek, front or get operation is also entered, returning the value of the front object without dequeuing it. A queue is an example of an abstractly a sequental collection.
Class instances can thrown the following exceptions:
- (void) addArray: | (SCArray *) | array |
Adds into the receiving queue objects from a given array.
array | - an array with objects to add into the receiving queue |
SCCollectionException | - collection error detected |
- (void) addObjectsFromArray: | (SCArray *) | array |
Adds into the receiving queue objects from a given array.
array | - an array with objects to add into the receiving queue |
SCCollectionException | - collection error detected |
- (void) addObjectsFromQueue: | (SCQueue *) | queue |
Adds into the receiving queue objects from a given another queue.
queue | - a queue with objects to add into the receiving queue |
SCCollectionException | - collection error detected |
- (void) addQueue: | (SCQueue *) | queue |
Adds into the receiving queue objects from a given another queue.
queue | - a queue with objects to add into the receiving queue |
SCCollectionException | - collection error detected |
- (void) duplicateFirstObject |
Duplicates the first object within the receiving queue.
SCCollectionException | - collection error detected |
- (void) duplicateLastObject |
Duplicates the last added into the receiving queue object.
SCCollectionException | - collection error detected |
- (id) getObject |
Returns and removes the first object from the receiving queue.
SCCollectionException | - collection error detected |
- (instancetype) init |
Initializes an empty unnamed queue.
Reimplemented from SCCollection.
- (instancetype) initWithArray: | (SCArray *) | array |
Initializes a newly allocates queue with objects from a given array.
array | - an array with objects to add into the queue |
SCCollectionException | - collection error detected |
- (instancetype) initWithCollection: | (id<SCCollection>) | collection |
Initializes a newly allocated queue with objects from the specified collection of any supported type.
collection | - a collection with objects to add into the queue |
SCCollectionException | - collection error detected |
Reimplemented from SCCollection.
- (instancetype) initWithName: | (NSString *) | name |
Initializes an empty queue using the specified queue name.
Designed initializer
name | - the queue name |
Reimplemented from SCCollection.
- (instancetype) initWithObject: | (id<SCCollectioning>) | object |
Initializes a newly allocated queue containing a given object.
object | - the object to adding into the queue |
- (instancetype) initWithObjects: | (id<SCCollectioning>) | object | |
, | NS_REQUIRES_NIL_TERMINATION | ||
Initializes a newly allocated queue containing objects from the specified list.
object | - the first object to add into the queue |
... | - a null-terminated list of alternating object to add into the queue |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- (instancetype) initWithQueue: | (SCQueue *) | queue |
Initializes a newly allocated queue by placing in it the objects contained in another given queue.
queue | - a queue containing the objects with which to initialized the new queue |
SCCollectionException | - collection error detected |
- (BOOL) isEqualToQueue: | (SCQueue *) | queue |
Returns a boolean value that indicates whether the settings and contents of the receiving queue are equal to the settings and contents of another given queue.
queue | - the queue with which to compare the receiving queue |
+ (instancetype) queue |
Creates and returns an unnamed empty queue.
Returns the new queue that contains objects from the receiving queue and objects from a given array.
array | - an array with objects to add to the new queue |
SCCollectionException | - collection error detected |
- (SCQueue *) queueByAddingCollection: | (id<SCCollection>) | collection |
Returns the new queue that contains objects from the receiving queue and objects from a given collection.
collection | - a collection with objects to add to the new queue |
SCCollectionException | - collection error detected |
- (SCQueue *) queueByAddingObject: | (id<SCCollectioning>) | object |
Returns the new queue with objects from the receiving queue and a given object.
object | - the object to add into the new queue |
SCCollectionException | - collection error detected |
- (SCQueue *) queueByAddingObjects: | (id<SCCollectioning>) | object | |
, | NS_REQUIRES_NIL_TERMINATION | ||
Returns a new queue that contains objects from the receiving queue and objects from the specified list.
object | - the first object to add into the new queue |
... | - a comma-separated list of additional objects, ending with nil pointer |
NS_REQUIRES_NIL_TERMINATION | - a mandatory nil pointer |
SCCollectionException | - collection error detected |
Returns the new queue that contains objects from the receiving queue and objects from a given array.
array | - an array with objects to add to the new queue |
SCCollectionException | - collection error detected |
Returns the new queue that contains objects from the receiving queue and a given another queue.
queue | - a queue with objects to add to the new queue |
SCCollectionException | - collection error detected |
Returns the new queue that contains objects from the receiving queue and a given another queue.
queue | - a queue with objects to add to the new queue |
SCCollectionException | - collection error detected |
+ (instancetype) queueWithArray: | (SCArray *) | array |
Returns a queue created by using objects from a given array.
array | - the array with objects to add to the new queue |
SCCollectionException | - collection error detected |
+ (instancetype) queueWithCoder: | (NSCoder *) | coder |
Returns a queue created by using the specified coder.
coder | - the source coder |
+ (instancetype) queueWithCollection: | (id<SCCollection>) | collection |
Returns a queue created by using the objects from the specified collection of any supported type.
collection | - the existing source collection |
SCCollectionException | - collection error detected |
+ (instancetype) queueWithContentsOfFile: | (NSString *) | path |
Returns a queue created by using the file with the specified path.
path | - the path to the source file |
+ (instancetype) queueWithContentsOfSerializedFile: | (NSString *) | path |
Returns a queue created by using the content of the serialized file with the specified file.
path | - the path of the source serialized file |
+ (instancetype) queueWithContentsOfURL: | (NSURL *) | url |
Returns a queue created by using the specified URL.
url | - the source URL |
+ (instancetype) queueWithContentsOfURLString: | (NSString *) | urlString |
Returns a queue created by using the data from the URL with the specified string.
urlString | - the string of the source URL |
+ (instancetype) queueWithData: | (NSData *) | data |
Returns a queue created by using the specified data object.
data | - the source data object |
+ (instancetype) queueWithDataDictionary: | (NSDictionary *) | dictionary |
Returns a queue created by using the specified data dictionary.
dictionary | - the source data dictionary |
+ (instancetype) queueWithDataDictionaryFromFile: | (NSString *) | path |
Returns a queue created by using the data dictionary from the specified file.
path | - the path of the source data dictionary file |
+ (instancetype) queueWithFileStream: | (NSString *) | path |
Returns a queue created by using the data from the file stream with the specified path.
path | - the path to the source file stream |
SCStreamException | - stream error detected |
SCSystemException | - system error detected |
+ (instancetype) queueWithName: | (NSString *) | name |
Returns an empty queue created by using the specified queue name.
name | - the name of the new queue |
+ (instancetype) queueWithObject: | (id<SCCollectioning>) | object |
Creates and returns a queue containing a given object.
object | - the object to adding into the queue |
+ (instancetype) queueWithObjects: | (id<SCCollectioning>) | object | |
, | NS_REQUIRES_NIL_TERMINATION | ||
Creates and returns a queue containing the objects from the specified list.
object | - the first object to add into the new queue |
... | - a null-terminated list of alternating objects to add into the new queue |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
+ (instancetype) queueWithQueue: | (SCQueue *) | queue |
Creates and returns a queue containing objects from another given queue.
queue | - a queue containing the objects with which to initializes a new queue |
SCCollectionException | - collection error detected |
+ (instancetype) queueWithStream: | (SCStream *) | stream |
Returns a queue created by using the data from the specified stream.
stream | - the source stream |
SCStreamException | - stream error detected |
SCSystemException | - system error detected |
- (void) removeFirstObject |
Removes the first object from the receiving queue.
SCCollectionException | - collection error detected |
- (void) removeLastObject |
Removes the last added object from the receiving queue.
SCCollectionException | - collection error detected |
- (void) setQueue: | (SCQueue *) | queue |
Sets the settings and contents of the receiving queue to settings and objects in a given queue.
queue | - the source queue |
SCCollectionException | - collection error detected |
|
readnonatomicassign |
The first object within the queue