Samond Classes Library 1.2.0-RELEASE build 166
List of all members
SCQueue Class Reference

Queue of objects class. More...

#import <SCQueue.h>

Inheritance diagram for SCQueue:
SCCollection SCObject <SCMutableCollection> <SCCoding> <SCDictionaring> <SCStreaming> <SCCollectioning> <SCCollection>

Creating Queues

(SCQueue *) + queueWithCoder:
 
(SCQueue *) + queueWithContentsOfSerializedFile:
 
(SCQueue *) + queueWithDataDictionary:
 
(SCQueue *) + queueWithDataDictionaryFromFile:
 
(SCQueue *) + queueWithStream:
 
(SCQueue *) + queueWithFileStream:
 
(SCQueue *) + queueWithName:
 
(SCQueue *) + queueWithObject:
 
(SCQueue *) + queueWithObjects:
 
(SCQueue *) + queueWithCollection:
 
(SCQueue *) + queueWithQueue:
 
(SCQueue *) + queue
 

Initializing Queues

(id) - initWithName:
 
(id) - initWithObject:
 
(id) - initWithObjects:
 
(id) - initWithCollection:
 
(id) - initWithQueue:
 
(id) - init
 

Copying Queues

(void) - setQueue:
 

Comparing Queues

(BOOL) - isEqualToQueue:
 
(BOOL) - isEqualToContentsOfQueue:
 

Getting Objects

(id) - getObject
 
(NSString *) - getString
 
(NSNumber *) - getNumber
 
(SCByte- getByte
 
(SCUByte- getUByte
 
(SCShort- getShort
 
(SCUShort- getUShort
 
(SCInteger- getInteger
 
(SCUInteger- getUInteger
 
(SCLong- getLong
 
(SCULong- getULong
 
(char) - getChar
 
(unichar) - getUnichar
 
(const char *) - getCharString
 
(BOOL) - getBool
 
(SCFloat- getFloat
 
(SCDouble- getDouble
 

Removing Objects

(void) - removeFirstObject
 
(void) - removeLastObject
 

Copying Objects

(void) - duplicateFirstObject
 
(void) - duplicateLastObject
 

Querying a Queue

id firstObject
 
NSString * firstString
 
NSNumber * firstNumber
 

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) - addByte:
 
(void) - addUByte:
 
(void) - addShort:
 
(void) - addUShort:
 
(void) - addInteger:
 
(void) - addUInteger:
 
(void) - addLong:
 
(void) - addULong:
 
(void) - addChar:
 
(void) - addUnichar:
 
(void) - addCharString:
 
(void) - addBool:
 
(void) - addFloat:
 
(void) - addDouble:
 
(void) - addCollection:
 
(void) - removeObjectsWithClass:
 
(void) - removeObjectsWithClassName:
 
(void) - removeCollection:
 
(void) - removeObject:
 
(void) - removeByte:
 
(void) - removeUByte:
 
(void) - removeShort:
 
(void) - removeUShort:
 
(void) - removeInteger:
 
(void) - removeUInteger:
 
(void) - removeLong:
 
(void) - removeULong:
 
(void) - removeChar:
 
(void) - removeUnichar:
 
(void) - removeCharString:
 
(void) - removeBool:
 
(void) - removeFloat:
 
(void) - removeDouble:
 
(void) - removeObjects:
 
(BOOL) - containsByte:
 
(BOOL) - containsUByte:
 
(BOOL) - containsShort:
 
(BOOL) - containsUShort:
 
(BOOL) - containsInteger:
 
(BOOL) - containsUInteger:
 
(BOOL) - containsLong:
 
(BOOL) - containsULong:
 
(BOOL) - containsChar:
 
(BOOL) - containsUnichar:
 
(BOOL) - containsCharString:
 
(BOOL) - containsBool:
 
(BOOL) - containsFloat:
 
(BOOL) - containsDouble:
 
(BOOL) - containsObjects:
 
(BOOL) - containsCollection:
 
(BOOL) - containsAnyObject:
 
(BOOL) - containsAnyObjectFromCollection:
 
(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) - isList
 
(BOOL) - isSortable
 
- Instance Methods inherited from SCObject
(id) - initWithContentsOfSerializedFile:
 
(BOOL) - writeContentsToSerializedFile:
 
(id) - initWithDataDictionaryFromFile:
 
(void) - writeToDataDictionaryFile:atomically:
 
(void) - writeToDataDictionaryFile:
 
(NSDictionary *) - dataDictionary
 
(id) - initWithFileStream:
 
(void) - writeToFileStream:
 
(void) - appendToFileStream:
 
- Instance Methods inherited from <SCCoding>
- Instance Methods inherited from <SCDictionaring>
- Instance Methods inherited from <SCCollectioning>
- 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
 
BOOL readOnly
 
id< SCCollectionDelegatedelegate
 
SCULong count
 
BOOL empty
 
NSString * typeName
 
NSString * description
 
NSEnumerator * objectEnumerator
 
NSEnumerator * reverseObjectEnumerator
 
- Properties inherited from <SCCollection>
SCULong count
 
BOOL empty
 
NSString * description
 
SCArrayarray
 
SCSetset
 
SCOrderedSetorderedSet
 
SCDictionarydictionary
 
SCStackstack
 
SCQueuequeue
 
SCUnidirectionalListunidirectionalList
 
SCBidirectionalListbidirectionalList
 
NSArray * foundationArray
 
NSSet * foundationSet
 
NSOrderedSet * foundationOrderedSet
 
NSDictionary * foundationDictionary
 
NSEnumerator * objectEnumerator
 

Detailed Description

Queue of objects class.

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) 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
- (BOOL) getBool

Returns and removes the first object from the receiving queue as a boolean value.

Returns
A first object or NO if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (SCByte) getByte

Returns and removes the first object from the receiving queue as a signed 8-bit integer value.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (char) getChar

Returns and removes the first object from the receiving queue as a character.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
See also
- getUnichar
- (const char *) getCharString

Returns and removes the first object from the receiving queue as a character string.

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

Returns and removes the first object from the receiving queue as a double value.

Returns
A first object or 0.0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (SCFloat) getFloat

Returns and removes the first object from the receiving queue as a float value.

Returns
A first object or 0.0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (SCInteger) getInteger

Returns and removes the first object from the receiving queue as a signed 32-bit integer value.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (SCLong) getLong

Returns and removes the first object from the receiving queue as a signed 64-bit integer value.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (NSNumber *) getNumber

Returns and removes the first object from the receiving queue as a number.

Returns
A first object or nil if the queue is empty
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
- (SCShort) getShort

Returns and removes the first object from the receiving queue as a signed 16-bit integer value.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (NSString *) getString

Returns and removes the first object from the receiving queue as a string.

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

Returns and removes the first object from the receiving queue as an unsigned 8-bit integer value.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (SCUInteger) getUInteger

Returns and removes the first object from the receiving queue as an unsigned 32-bit integer value.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (SCULong) getULong

Returns and removes the first object from the receiving queue as an unsigned 64-bit integer value.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
- (unichar) getUnichar

Returns and removes the first object from the receiving queue as a character.

Returns
A first object or 0 if the queue is empty
Exceptions
SCCollectionException- collection error detected
See also
- getChar
- (SCUShort) getUShort

Returns and removes the first object from the receiving queue as an unsigned 16-bit integer value.

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

Initializes an empty unnamed queue.

Returns
A newly initialized queue
- (id) initWithCollection: (id)  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.

- (id) initWithName: (NSString *)  name

Initializes an empty queue using the specified queue name.

Attention
Designed initializer
Parameters
name- the queue name
Returns
A newly initialized queue
- (id) initWithObject: (id)  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
- (id) initWithObjects: (id)  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
- (id) 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) isEqualToContentsOfQueue: (SCQueue *)  queue

Returns a boolean value that indicates whether the contents of the receiving queue are equal to the contents of another given queue.

Parameters
queue- the queue with which to compate the receiving queue
Returns
YES if the contents of the specified queue are equal to the content of the receiving queue, otherwise NO
- (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
+ (SCQueue *) queue

Creates and returns an unnamed empty queue.

Returns
A created queue

Reimplemented from SCCollection.

+ (SCQueue *) queueWithCoder: (NSCoder *)  coder

Returns a queue created by using the specified coder.

Parameters
coder- the source coder
Returns
A created queue
+ (SCQueue *) queueWithCollection: (id)  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
+ (SCQueue *) 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
+ (SCQueue *) queueWithDataDictionary: (NSDictionary *)  dictionary

Returns a queue created by using the specified data dictionary.

Parameters
dictionary- the source data dictionary
Returns
A created queue
+ (SCQueue *) 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
+ (SCQueue *) 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
+ (SCQueue *) 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
+ (SCQueue *) queueWithObject: (id)  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
+ (SCQueue *) queueWithObjects: (id)  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
+ (SCQueue *) 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
+ (SCQueue *) 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

- (NSNumber *) firstNumber
readnonatomicretain

The first object within the queue as a number

- (id) firstObject
readnonatomicretain

The first object within the queue

- (NSString *) firstString
readnonatomicretain

The first object within the queue as a string


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