Samond Classes Library 1.2.6-STABLE build 219
List of all members
SCQueue Class Reference

Queue of objects class. More...

#import <SCQueue.h>

+ Inheritance diagram for SCQueue:

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
 

Additional Inherited Members

- Instance Methods inherited from SCCollection
(void) - setCollection:
 
(void) - setObject:
 
(void) - setObjects:
 
(BOOL) - isEqualToCollection:
 
(BOOL) - isEqual:
 
(void) - enumerateWithDelegate:
 
(void) - enumerate
 
(void) - reverseEnumerateWithDelegate:
 
(void) - reverseEnumerate
 
(void) - addObjects:
 
(void) - addCollection:
 
(void) - removeObjectsWithClass:
 
(void) - removeObjectsWithClassName:
 
(void) - removeCollection:
 
(void) - removeObject:
 
(void) - removeObjects:
 
(BOOL) - containsObjects:
 
(BOOL) - containsCollection:
 
(BOOL) - containsAnyObject:
 
(BOOL) - containsAnyObjectFromCollection:
 
- Instance Methods inherited from SCObject
(instancetype) - initWithContentsOfSerializedFile:
 
(BOOL) - writeContentsToSerializedFile:
 
(instancetype) - initWithDataDictionaryFromFile:
 
(void) - writeToDataDictionaryFile:atomically:
 
(void) - writeToDataDictionaryFile:
 
(NSDictionary *) - dataDictionary
 
(instancetype) - initWithFileStream:
 
(void) - writeToFileStream:
 
(void) - appendToFileStream:
 
(instancetype) - initWithData:
 
(instancetype) - initWithContentsOfFile:
 
(instancetype) - initWithContentsOfURL:
 
(instancetype) - initWithContentsOfURLString:
 
(BOOL) - writeToFile:
 
(BOOL) - writeToURL:
 
(BOOL) - writeToURLString:
 
(NSData *) - data
 
- Instance Methods inherited from <SCMutableCollection>
- Instance Methods inherited from <SCCollection>
- Class Methods inherited from SCCollection
(BOOL) + isCollectionClass:
 
(BOOL) + isLibraryCollectionClass:
 
(BOOL) + isFoundationCollectionClass:
 
(BOOL) + isArrayClass:
 
(BOOL) + isLibraryArrayClass:
 
(BOOL) + isFoundationArrayClass:
 
(BOOL) + isSetClass:
 
(BOOL) + isLibrarySetClass:
 
(BOOL) + isFoundationSetClass:
 
(BOOL) + isOrderedSetClass:
 
(BOOL) + isLibraryOrderedSetClass:
 
(BOOL) + isFoundationOrderedSetClass:
 
(BOOL) + isDictionaryClass:
 
(BOOL) + isLibraryDictionaryClass:
 
(BOOL) + isFoundationDictionaryClass:
 
(BOOL) + isStackClass:
 
(BOOL) + isQueueClass:
 
(BOOL) + isListClass:
 
(BOOL) + isSortableClass:
 
(BOOL) + isCollection:
 
(BOOL) + isLibraryCollection:
 
(BOOL) + isFoundationCollection:
 
(BOOL) + isArray:
 
(BOOL) + isLibraryArray:
 
(BOOL) + isFoundationArray:
 
(BOOL) + isSet:
 
(BOOL) + isLibrarySet:
 
(BOOL) + isFoundationSet:
 
(BOOL) + isOrderedSet:
 
(BOOL) + isLibraryOrderedSet:
 
(BOOL) + isFoundationOrderedSet:
 
(BOOL) + isDictionary:
 
(BOOL) + isLibraryDictionary:
 
(BOOL) + isFoundationDictionary:
 
(BOOL) + isStack:
 
(BOOL) + isQueue:
 
(BOOL) + isList:
 
(BOOL) + isSortable:
 
- Properties inherited from SCCollection
NSString * name
 
SCIndex count
 
BOOL empty
 
BOOL readOnly
 
id< SCCollectionDelegatedelegate
 
NSString * typeName
 
NSEnumerator * objectEnumerator
 
NSEnumerator * reverseObjectEnumerator
 
SCArrayarray
 
SCSetset
 
SCOrderedSetorderedSet
 
SCDictionarydictionary
 
SCStackstack
 
SCQueuequeue
 
SCUnidirectionalListunidirectionalList
 
SCBidirectionalListbidirectionalList
 
NSArray * foundationArray
 
NSSet * foundationSet
 
NSOrderedSet * foundationOrderedSet
 
NSDictionary * foundationDictionary
 
SCCollectionType collectionType
 
BOOL isCollection
 
BOOL isLibraryCollection
 
BOOL isFoundationCollection
 
BOOL isArray
 
BOOL isLibraryArray
 
BOOL isFoundationArray
 
BOOL isSet
 
BOOL isLibrarySet
 
BOOL isFoundationSet
 
BOOL isOrderedSet
 
BOOL isLibraryOrderedSet
 
BOOL isFoundationOrderedSet
 
BOOL isDictionary
 
BOOL isLibraryDictionary
 
BOOL isFoundationDictionary
 
BOOL isStack
 
BOOL isQueue
 
BOOL isList
 
BOOL isSortable
 
- Properties inherited from SCObject
NSString * className
 
- Properties inherited from <SCCollection>
NSString * name
 
SCIndex count
 
BOOL empty
 
BOOL readOnly
 
id< SCCollectionDelegatedelegate
 
SCArrayarray
 
SCSetset
 
SCOrderedSetorderedSet
 
SCDictionarydictionary
 
SCStackstack
 
SCQueuequeue
 
SCUnidirectionalListunidirectionalList
 
SCBidirectionalListbidirectionalList
 
NSArray * foundationArray
 
NSSet * foundationSet
 
NSOrderedSet * foundationOrderedSet
 
NSDictionary * foundationDictionary
 
NSEnumerator * objectEnumerator
 
NSEnumerator * reverseObjectEnumerator
 
SCCollectionType collectionType
 
BOOL isCollection
 
BOOL isLibraryCollection
 
BOOL isFoundationCollection
 
BOOL isArray
 
BOOL isLibraryArray
 
BOOL isFoundationArray
 
BOOL isSet
 
BOOL isLibrarySet
 
BOOL isFoundationSet
 
BOOL isOrderedSet
 
BOOL isLibraryOrderedSet
 
BOOL isFoundationOrderedSet
 
BOOL isDictionary
 
BOOL isLibraryDictionary
 
BOOL isFoundationDictionary
 
BOOL isStack
 
BOOL isQueue
 
BOOL isList
 
BOOL isSortable
 

Detailed Description

Queue of objects class.

SDK
macOS 10.6+, iOS 7.0+, GNUstep
Since
version 1.1.3

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:

Method Documentation

- (void) addArray: (SCArray *)  array

Adds into the receiving queue objects from a given array.

Parameters
array- an array with objects to add into the receiving queue
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
See also
- addObjectsFromArray:
- (void) addObjectsFromArray: (SCArray *)  array

Adds into the receiving queue objects from a given array.

Parameters
array- an array with objects to add into the receiving queue
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
See also
- addArray:
- (void) addObjectsFromQueue: (SCQueue *)  queue

Adds into the receiving queue objects from a given another queue.

Parameters
queue- a queue with objects to add into the receiving queue
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
See also
- addQueue:
- (void) addQueue: (SCQueue *)  queue

Adds into the receiving queue objects from a given another queue.

Parameters
queue- a queue with objects to add into the receiving queue
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
See also
- addObjectsFromQueue:
- (void) duplicateFirstObject

Duplicates the first object within the receiving queue.

Exceptions
SCCollectionException- collection error detected
- (void) duplicateLastObject

Duplicates the last added into the receiving queue object.

Exceptions
SCCollectionException- collection error detected
- (id) getObject

Returns and removes the first object from the receiving queue.

Returns
A first object or nil if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (instancetype) init

Initializes an empty unnamed queue.

Returns
A newly initialized queue

Reimplemented from SCCollection.

- (instancetype) initWithArray: (SCArray *)  array

Initializes a newly allocates queue with objects from a given array.

Parameters
array- an array with objects to add into the queue
Returns
An initialized queue with the objects from the specified array
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
- (instancetype) initWithCollection: (id<SCCollection>)  collection

Initializes a newly allocated queue with objects from the specified collection of any supported type.

Parameters
collection- a collection with objects to add into the queue
Returns
An initialized queue with the objects from a given collection
Exceptions
SCCollectionException- collection error detected

Reimplemented from SCCollection.

- (instancetype) initWithName: (NSString *)  name

Initializes an empty queue using the specified queue name.
Designed initializer

Parameters
name- the queue name
Returns
A newly initialized queue

Reimplemented from SCCollection.

- (instancetype) initWithObject: (id<SCCollectioning>)  object

Initializes a newly allocated queue containing a given object.

Parameters
object- the object to adding into the queue
Returns
An initialized queue containing a single object
- (instancetype) initWithObjects: (id<SCCollectioning>)  object
,   NS_REQUIRES_NIL_TERMINATION 

Initializes a newly allocated queue containing objects from the specified list.

Parameters
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
Returns
An initialized queue containing the specified objects
- (instancetype) initWithQueue: (SCQueue *)  queue

Initializes a newly allocated queue by placing in it the objects contained in another given queue.

Attention
Designed initializer
Parameters
queue- a queue containing the objects with which to initialized the new queue
Returns
An initialized queue containing the objects found in the specified source queue
Exceptions
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.

Parameters
queue- the queue with which to compare the receiving queue
Returns
YES if the settings and contents of the specified queue are equal to the settings and contents of the receiving queue, otherwise NO
+ (instancetype) queue

Creates and returns an unnamed empty queue.

Returns
A created queue
- (SCQueue *) queueByAddingArray: (SCArray *)  array

Returns the new queue that contains objects from the receiving queue and objects from a given array.

Parameters
array- an array with objects to add to the new queue
Returns
A queue with objects from the receiving queue and objects from a given array
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
See also
- queueByAddingObjectsFromArray:
- (SCQueue *) queueByAddingCollection: (id<SCCollection>)  collection

Returns the new queue that contains objects from the receiving queue and objects from a given collection.

Parameters
collection- a collection with objects to add to the new queue
Returns
A new queue with objects from the receiving queue and objects from the specified collection
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
- (SCQueue *) queueByAddingObject: (id<SCCollectioning>)  object

Returns the new queue with objects from the receiving queue and a given object.

Parameters
object- the object to add into the new queue
Returns
A queue with objects from the receiving queue and a given object
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
- (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.

Parameters
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
Returns
A new queue with objects from the receiving queue and objects from the specified list
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
- (SCQueue *) queueByAddingObjectsFromArray: (SCArray *)  array

Returns the new queue that contains objects from the receiving queue and objects from a given array.

Parameters
array- an array with objects to add to the new queue
Returns
A queue with objects from the receiving queue and objects from a given array
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
See also
- queueByAddingArray:
- (SCQueue *) queueByAddingObjectsFromQueue: (SCQueue *)  queue

Returns the new queue that contains objects from the receiving queue and a given another queue.

Parameters
queue- a queue with objects to add to the new queue
Returns
A queue with objects from the receiving queue and a given queue
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
See also
- queueByAddingQueue:
- (SCQueue *) queueByAddingQueue: (SCQueue *)  queue

Returns the new queue that contains objects from the receiving queue and a given another queue.

Parameters
queue- a queue with objects to add to the new queue
Returns
A queue with objects from the receiving queue and a given queue
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
See also
- queueByAddingObjectsFromQueue:
+ (instancetype) queueWithArray: (SCArray *)  array

Returns a queue created by using objects from a given array.

Parameters
array- the array with objects to add to the new queue
Returns
A created queue
Exceptions
SCCollectionException- collection error detected
Since
version 1.2.3
+ (instancetype) queueWithCoder: (NSCoder *)  coder

Returns a queue created by using the specified coder.

Parameters
coder- the source coder
Returns
A created queue
+ (instancetype) queueWithCollection: (id<SCCollection>)  collection

Returns a queue created by using the objects from the specified collection of any supported type.

Parameters
collection- the existing source collection
Returns
A created queue
Exceptions
SCCollectionException- collection error detected
+ (instancetype) queueWithContentsOfFile: (NSString *)  path

Returns a queue created by using the file with the specified path.

Parameters
path- the path to the source file
Returns
A created queue
+ (instancetype) queueWithContentsOfSerializedFile: (NSString *)  path

Returns a queue created by using the content of the serialized file with the specified file.

Parameters
path- the path of the source serialized file
Returns
A created queue
+ (instancetype) queueWithContentsOfURL: (NSURL *)  url

Returns a queue created by using the specified URL.

Parameters
url- the source URL
Returns
A created queue
+ (instancetype) queueWithContentsOfURLString: (NSString *)  urlString

Returns a queue created by using the data from the URL with the specified string.

Parameters
urlString- the string of the source URL
Returns
A created queue
+ (instancetype) queueWithData: (NSData *)  data

Returns a queue created by using the specified data object.

Parameters
data- the source data object
Returns
A created queue
+ (instancetype) queueWithDataDictionary: (NSDictionary *)  dictionary

Returns a queue created by using the specified data dictionary.

Parameters
dictionary- the source data dictionary
Returns
A created queue
+ (instancetype) queueWithDataDictionaryFromFile: (NSString *)  path

Returns a queue created by using the data dictionary from the specified file.

Parameters
path- the path of the source data dictionary file
Returns
A created queue
+ (instancetype) queueWithFileStream: (NSString *)  path

Returns a queue created by using the data from the file stream with the specified path.

Parameters
path- the path to the source file stream
Returns
A created queue
Exceptions
SCStreamException- stream error detected
SCSystemException- system error detected
+ (instancetype) queueWithName: (NSString *)  name

Returns an empty queue created by using the specified queue name.

Parameters
name- the name of the new queue
Returns
A created queue
+ (instancetype) queueWithObject: (id<SCCollectioning>)  object

Creates and returns a queue containing a given object.

Parameters
object- the object to adding into the queue
Returns
A new queue containing a single object
+ (instancetype) queueWithObjects: (id<SCCollectioning>)  object
,   NS_REQUIRES_NIL_TERMINATION 

Creates and returns a queue containing the objects from the specified list.

Parameters
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
Returns
A new queue containing the specified objects
+ (instancetype) queueWithQueue: (SCQueue *)  queue

Creates and returns a queue containing objects from another given queue.

Parameters
queue- a queue containing the objects with which to initializes a new queue
Returns
A new queue containing the objects found in the specified queue
Exceptions
SCCollectionException- collection error detected
+ (instancetype) queueWithStream: (SCStream *)  stream

Returns a queue created by using the data from the specified stream.

Parameters
stream- the source stream
Returns
A created queue
Exceptions
SCStreamException- stream error detected
SCSystemException- system error detected
- (void) removeFirstObject

Removes the first object from the receiving queue.

Exceptions
SCCollectionException- collection error detected
- (void) removeLastObject

Removes the last added object from the receiving queue.

Exceptions
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.

Parameters
queue- the source queue
Exceptions
SCCollectionException- collection error detected

Property Documentation

- (id) firstObject
readnonatomicassign

The first object within the queue


The documentation for this class was generated from the following files: