Samond Classes Library 1.1.6-RELEASE build 132

SCStack Class Reference

Objects stack representation class. More...

#import <SCStack.h>

Inheritance diagram for SCStack:
SCCollection SCObject <SCDictionaryObjectProtocol> <SCCodingProtocol> <SCStreamProtocol> <SCCollectionProtocol>

List of all members.

Public Member Functions

Initializing Stack
(id) - init
(id) - initWithStackName:capacity:
(id) - initWithStackName:
(id) - initWithCapacity:
(id) - initWithDelegate:
(id) - initWithDelegate:collection:
(id) - initWithCollection:
(id) - initWithDelegate:object:
(id) - initWithObject:
(id) - initWithDelegate:objects:
(id) - initWithObjects:
(id) - initWithStack:
Querying and Setting Stack Properties
(NSString *) - stackName
(void) - setStackName:
Querying Stack
(id) - lastObject
(NSString *) - lastString
(NSNumber *) - lastNumber
(SCByte- lastByte
(SCUByte- lastUByte
(SCShort- lastShort
(SCUShort- lastUShort
(SCInteger- lastInteger
(SCUInteger- lastUInteger
(SCLong- lastLong
(SCULong- lastULong
(char) - lastChar
(unichar) - lastUnichar
(const char *) - lastCharString
(BOOL) - lastBool
(SCFloat- lastFloat
(SCDouble- lastDouble
Pushing Objects
(void) - pushObject:
(void) - pushByte:
(void) - pushUByte:
(void) - pushShort:
(void) - pushUShort:
(void) - pushInteger:
(void) - pushUInteger:
(void) - pushLong:
(void) - pushULong:
(void) - pushChar:
(void) - pushUnichar:
(void) - pushCharString:
(void) - pushBool:
(void) - pushFloat:
(void) - pushDouble:
(void) - pushObjects:
(void) - pushObjectsFromCollection:
Poping Objects
(void) - pop
(id) - popObject
(NSString *) - popString
(NSNumber *) - popNumber
(SCByte- popByte
(SCUByte- popUByte
(SCShort- popShort
(SCUShort- popUShort
(SCInteger- popInteger
(SCUInteger- popUInteger
(SCLong- popLong
(SCULong- popULong
(char) - popChar
(unichar) - popUnichar
(const char *) - popCharString
(BOOL) - popBool
(SCFloat- popFloat
(SCDouble- popDouble
Removing Objects
(void) - removeLastObject
Copying Objects
(void) - duplicateLastObject

Static Public Member Functions

Creating Stack
(SCStack *) + stackWithDataDictionary:
(SCStack *) + stackWithDataDictionaryFromFile:
(SCStack *) + stackWithCoder:
(SCStack *) + stackWithContentsOfSerializedFile:
(SCStack *) + stackWithStream:
(SCStack *) + stackWithFileStream:
(SCStack *) + stack
(SCStack *) + stackWithStackName:capacity:
(SCStack *) + stackWithStackName:
(SCStack *) + stackWithCapacity:
(SCStack *) + stackWithDelegate:
(SCStack *) + stackWithDelegate:collection:
(SCStack *) + stackWithCollection:
(SCStack *) + stackWithDelegate:object:
(SCStack *) + stackWithObject:
(SCStack *) + stackWithDelegate:objects:
(SCStack *) + stackWithObjects:
(SCStack *) + stackWithStack:

Detailed Description

Objects stack representation class.

Class represents the objects stack - collection, in which items are stored in reverse order of adding, with access only to the last added item.
Class was introduced in version 1.1.3.

Class declares the following properties:


Member Function Documentation

- (void) duplicateLastObject

Duplicates the object from the top of the receiving stack.

Exceptions:
SCCollectionException- stack error detected
- (id) init

Initializes the stack using the default settings.

Returns:
A newly initialized stack

Reimplemented from SCCollection.

- (id) initWithCapacity: (SCULong capacity

Initializes the stack using the specified stack capacity.

Parameters:
capacity- stack capacity
Returns:
A newly initialized stack
- (id) initWithCollection: (id)  collection

Initializes the stack using the specified existing collection.

Parameters:
collection- existing source collection
Returns:
A newly initialized stack
Exceptions:
SCCollectionException- stack error detected
- (id) initWithDelegate: (id<SCCollectionDelegate>)  delegate

Initializes the stack using the specified delegate object.

Parameters:
delegate- delegate object
Returns:
A newly initialized stack
- (id) initWithDelegate: (id<SCCollectionDelegate>)  delegate
collection: (id)  collection 

Initializes the stack using the specified delegate object and existing collection.

Parameters:
delegate- delegate object
collection- existing source collection
Returns:
A newly initialized stack
Exceptions:
SCCollectionException- stack error detected
- (id) initWithDelegate: (id<SCCollectionDelegate>)  delegate
object: (id)  object 

Initializes the stack using the specified delegate object and existing object.

Parameters:
delegate- delegate object
object- existing source object
Returns:
A newly initialized stack
Exceptions:
SCCollectionException- stack error detected
- (id) initWithDelegate: (id<SCCollectionDelegate>)  delegate
objects: (id)  object
,   ... 

Initializes the stack using the specified delegate objects and nil terminated list of existing objects.

Parameters:
delegate- delegate object
object- first object
...- other objects
Returns:
A newly initialized stack
Exceptions:
SCCollectionException- stack error detected
- (id) initWithObject: (id)  object

Initializes the stack using the specified existing object.

Parameters:
object- existing source object
Returns:
A newly initialized stack
Exceptions:
SCCollectionException- stack error detected
- (id) initWithObjects: (id)  object
,   ... 

Initializes the stack using the specified nil terminated list of existing objects.

Parameters:
object- first object
...- other objects
Returns:
A newly initialized stack
Exceptions:
SCCollectionException- stack error detected
- (id) initWithStack: (SCStack *)  stack

Initializes the stack using the existing stack.

Parameters:
stack- source stack
Returns:
A newly initialized stack
Exceptions:
SCCollectionError- stack error detected
- (id) initWithStackName: (NSString *)  name

Initializes the stack using the specified stack name.

Parameters:
name- stack name
Returns:
A newly initialized stack
- (id) initWithStackName: (NSString *)  name
capacity: (SCULong capacity 

Initializes the stack using the specified stack name and capacity.

Parameters:
name- stack name
capacity- stack capacity
Returns:
A newly initialized stack
- (BOOL) lastBool

Returns as a boolean value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCByte) lastByte

Returns as a signed 8-bit value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (char) lastChar

Returns as a char value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (const char *) lastCharString

Returns as a char string the object from the top of the receiving stack without deleting.

Returns:
Last char string from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCDouble) lastDouble

Returns as a double precision float value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCFloat) lastFloat

Returns as a single precision float value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCInteger) lastInteger

Returns as a signed 32-bit value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCLong) lastLong

Returns as a signed 64-bit value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (NSNumber *) lastNumber

Returns as a number the object from the top of the receiving stack without deleting.

Returns:
Last number from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (id) lastObject

Returns the object from the top of the receiving stack without deleting.

Returns:
Last object or nil if the receiving stack is empty
- (SCShort) lastShort

Returns as a signed 16-bit value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (NSString *) lastString

Returns as a string the object from the top of the receiving stack without deleting.

Returns:
Last string from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCUByte) lastUByte

Returns as an unsigned 8-bit value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCUInteger) lastUInteger

Returns as an unsigned 32-bit value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCULong) lastULong

Returns as an unsigned 64-bit value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (unichar) lastUnichar

Returns as an unichar value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCUShort) lastUShort

Returns as an unsigned 16-bit value the object from the top of the receiving stack without deleting.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (void) pop

Removes the object from the top of the receiving stack without returning the poped object.

Exceptions:
SCCollectionException- stack error detected
- (BOOL) popBool

Returns as a bolean value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCByte) popByte

Returns as a signed 8-bit integer value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (char) popChar

Returns as a char value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (const char *) popCharString

Returns as a char string and removes the object from the top of the receiving stack.

Returns:
Last string from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCDouble) popDouble

Returns as a double precision float value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCFloat) popFloat

Returns as a single precision float value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCInteger) popInteger

Returns as a signed 32-bit integer value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCLong) popLong

Returns as a signed 64-bit integer value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (NSNumber *) popNumber

Returns as a number and removes the object from the top of the receiving stack.

Returns:
Last number from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (id) popObject

Returns and removes the object from the top of the receiving stack.

Returns:
Last object from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCShort) popShort

Returns as a signed 16-bit integer value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (NSString *) popString

Returns as a string and removes the object from the top of the receiving stack.

Returns:
Last string from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCUByte) popUByte

Returns as an unsigned 8-bit integer value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCUInteger) popUInteger

Returns as an unsigned 32-bit integer value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCULong) popULong

Returns as an unsigned 64-bit integer value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (unichar) popUnichar

Returns as an unichar value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (SCUShort) popUShort

Returns as an unsigned 16-bit integer value and removes the object from the top of the receiving stack.

Returns:
Last value from the receiving stack
Exceptions:
SCCollectionException- stack error detected
- (void) pushBool: (BOOL)  boolean

Pushes into the receiving stack the specified boolean value.

Parameters:
boolean- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushByte: (SCByte byte

Pushes into the receiving stack the specified signed 8-bit integer value.

Parameters:
byte- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushChar: (char)  chr

Pushes into the receiving stack the specified char value.

Parameters:
chr- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushCharString: (const char *)  string

Pushes into the receiving stack the specified char string.

Parameters:
string- pushed string
Exceptions:
SCCollectionException- stack error detected
- (void) pushDouble: (SCDouble dbl

Pushes into the receiving stack the specified double precision float value.

Parameters:
dbl- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushFloat: (SCFloat flt

Pushes into the receiving stack the specified single precision float value.

Parameters:
flt- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushInteger: (SCInteger integer

Pushes into the receiving stack the specified signed 32-bit integer value.

Parameters:
integer- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushLong: (SCLong longint

Pushes into the receiving stack the specified signed 64-bit integer value.

Parameters:
longint- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushObject: (id)  object

Pushes into the receiving stack the specified object.

Parameters:
object- pushed object
Exceptions:
SCCollectionException- stack error detected
- (void) pushObjects: (id)  object
,   ... 

Pushes into the receiving stack the objects from the specified nil terminated list.

Parameters:
object- first pushed object
...- other pushed objects
Exceptions:
SCCollectionException- stack error detected
- (void) pushObjectsFromCollection: (id)  collection

Pushes into the receiving stack the objects from the specified collection.

Parameters:
collection- source collection
Exceptions:
SCCollectionException- stack error detected
- (void) pushShort: (SCShort shortint

Pushes into the receiving stack the specified signed 16-bit integer value.

Parameters:
shortint- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushUByte: (SCUByte byte

Pushes into the receiving stack the specified unsigned 8-bit integer value.

Parameters:
byte- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushUInteger: (SCUInteger integer

Pushes into the receiving stack the specified unsigned 32-bit integer value.

Parameters:
integer- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushULong: (SCULong longint

Pushes into the receiving stack the specified unsigned 64-bit integer value.

Parameters:
longint- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushUnichar: (unichar)  chr

Pushes into the receiving stack the specified unichar value.

Parameters:
chr- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) pushUShort: (SCUShort shortint

Pushes into the receiving stack the specified unsigned 16-bit integer value.

Parameters:
shortint- pushed value
Exceptions:
SCCollectionException- stack error detected
- (void) removeLastObject

Removes the object from the top of the receiving stack.

Exceptions:
SCCollectionException- stack error detected
- (void) setStackName: (NSString *)  name

Sets the receiving stack name.

Parameters:
name- stack name
+ (SCStack *) stack

Returns the stack created by using the default settings.

Returns:
A created stack

Reimplemented from SCCollection.

- (NSString *) stackName

Returns the receiving stack name.

Returns:
Stack name
+ (SCStack *) stackWithCapacity: (SCULong capacity

Returns the stack created by using the specified stack capacity.

Parameters:
capacity- stack capacity
Returns:
A created stack
+ (SCStack *) stackWithCoder: (NSCoder *)  coder

Returns a stack created by using the specified coder.

Parameters:
coder- source coder
Returns:
A created stack
+ (SCStack *) stackWithCollection: (id)  collection

Returns the stack created by using the specified existing collection.

Parameters:
collection- existing source collection
Returns:
A created stack
Exceptions:
SCCollectionException- stack error detected
+ (SCStack *) stackWithContentsOfSerializedFile: (NSString *)  path

Returns a stack created by using the contents of serialized file with the specified path.

Parameters:
path- source serialized file path
Returns:
A created stack
+ (SCStack *) stackWithDataDictionary: (NSDictionary *)  dictionary

Returns a stack created by using the specified dictionary.

Parameters:
dictionary- source dictionary
Returns:
A created stack
+ (SCStack *) stackWithDataDictionaryFromFile: (NSString *)  path

Returns a stack created by using the dictionary from the specified file.

Parameters:
path- source dictionary file path
Returns:
A created stack
+ (SCStack *) stackWithDelegate: (id<SCCollectionDelegate>)  delegate

Returns the stack created by using the specified delegate object.

Parameters:
delegate- delegate object
Returns:
A created stack
+ (SCStack *) stackWithDelegate: (id<SCCollectionDelegate>)  delegate
collection: (id)  collection 

Returns the stack created by using the specified delegate object and existing collection.

Parameters:
delegate- delegate object
collection- existing source collection
Returns:
A created stack
Exceptions:
SCCollectionException- stack error detected
+ (SCStack *) stackWithDelegate: (id<SCCollectionDelegate>)  delegate
object: (id)  object 

Returns the stack created by using the specified delegate object and existing object.

Parameters:
delegate- delegate object
object- existing source object
Returns:
A created stack
Exceptions:
SCCollectionException- stack error detected
+ (SCStack *) stackWithDelegate: (id<SCCollectionDelegate>)  delegate
objects: (id)  object
,   ... 

Returns the stack created by using the specified delegate objects and nil terminated list of existing objects.

Parameters:
delegate- delegate object
object- first object
...- other objects
Returns:
A created stack
Exceptions:
SCCollectionException- stack error detected
+ (SCStack *) stackWithFileStream: (NSString *)  path

Returns a stack created from the stream file with the specified path.

Parameters:
path- stream file path
Returns:
A created stack
Exceptions:
SCStreamException- stream operation error detected

Returns a stack created from the stream file with the specified path.

Parameters:
path- stream file path
Returns:
A created stack
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (SCStack *) stackWithObject: (id)  object

Returns the stack created by using the specified existing object.

Parameters:
object- existing source object
Returns:
A created stack
Exceptions:
SCCollectionException- stack error detected
+ (SCStack *) stackWithObjects: (id)  object
,   ... 

Returns the stack created by using the specified nil terminated list of existing objects.

Parameters:
object- first object
...- other objects
Returns:
A created stack
Exceptions:
SCCollectionException- array error detected
+ (SCStack *) stackWithStack: (SCStack *)  stack

Returns the stack created by using the existing stack.

Parameters:
stack- source stack
Returns:
A created stack
Exceptions:
SCCollectionError- stack error detected
+ (SCStack *) stackWithStackName: (NSString *)  name

Returns the stack created by using the specified stack name.

Parameters:
name- stack name
Returns:
A created stack
+ (SCStack *) stackWithStackName: (NSString *)  name
capacity: (SCULong capacity 

Returns the stack created by using the specified stack name and capacity.

Parameters:
name- stack name
capacity- stack capacity
Returns:
A created stack
+ (SCStack *) stackWithStream: (SCStream *)  stream

Returns a stack created from the specified stream.

Parameters:
stream- stream for reading stack
Returns:
A created stack
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

The documentation for this class was generated from the following files:
 All Classes Files Functions Typedefs Enumerations Enumerator Defines