Samond Classes Library 1.1.6-RELEASE build 132

NSNumber(SCNumber) Category Reference

Additional functionality for class NSNumber. More...

#import <SCNumber.h>

List of all members.

Public Member Functions

Initializing NSNumber Object
(id) - initWithNumber:
(id) - initWithByte:
(id) - initWithUnsignedByte:
(id) - initWithDataDictionary:
(id) - initWithDataDictionaryFromFile:
(id) - initWithContentsOfSerializedFile:
(id) - initWithStream:
(id) - initWithFileStream:
Supporting Data Dictionaries
(void) - writeToDataDictionary:
(void) - writeToDataDictionaryFile:atomically:
(void) - writeToDataDictionaryFile:
(NSDictionary *) - dataDictionary
Supportiting Serialized Files
(BOOL) - writeContentsToSerializedFile:
Supporting Streams
(void) - writeToStream:
(void) - writeToFileStream:
(void) - appendToFileStream:
Supporting Collections
(id< SCCollectionProtocol >) - copyObject
(SCComparisonResult- compareWithObject:
Detecting NSNumber Object Type
(SCStandardType- type
Accessing Values
(SCByte- byteValue
(SCUByte- unsignedByteValue
Comparing Numbers
(BOOL) - isEqualToByte:
(BOOL) - isEqualToShort:
(BOOL) - isEqualToInt:
(BOOL) - isEqualToLongLong:
(BOOL) - isEqualToUnsignedByte:
(BOOL) - isEqualToUnsignedShort:
(BOOL) - isEqualToUnsignedInt:
(BOOL) - isEqualToUnsignedLongLong:
(BOOL) - isEqualToFloat:
(BOOL) - isEqualToDouble:
(BOOL) - isEqualToChar:
(BOOL) - isEqualToBool:
Other Methods
(NSString *) - className

Static Public Member Functions

Creating NSNumber Object
(NSNumber *) + numberWithNumber:
(NSNumber *) + numberWithByte:
(NSNumber *) + numberWithUnsignedByte:
(NSNumber *) + numberWithDataDictionary:
(NSNumber *) + numberWithDataDictionaryFromFile:
(NSNumber *) + numberWithContentsOfSerializedFile:
(NSNumber *) + numberWithStream:
(NSNumber *) + numberWithFileStream:

Detailed Description

Additional functionality for class NSNumber.

Category SCNumber extends functionality of standard class NSNumber.
This category was introduced in version 1.1.3.

Category declares the following properties:


Member Function Documentation

- (void) appendToFileStream: (NSString *)  path

Appends the receiver's number to the new or existing stream file with the specified path.

Parameters:
path- stream file path
Exceptions:
SCStreamException- stream operation error detected
- (SCByte) byteValue

Returns the signed 8-bit integer representation of the receiver's number.

Returns:
Signed 8-bit integer representation
- (NSString *) className

Returns the receiver's number class name.

Returns:
Class name
- (SCComparisonResult) compareWithObject: (id<SCCollectionProtocol>)  object

Returns the result of comparison receiver's instance with the specified instance.

Parameters:
object- second instance for comparison
Returns:
Result of comparison:
  • SCComparisonEqual - instances are equal
  • SCComparisonLess - the receiver's instance is less than second instance
  • SCComparisonGreater - the receiver's instance is greater than second instance
  • SCComparisonNotAllowed - instances cannot be compared
Exceptions:
SCCollectionException- incompatible second instance detected
- (id< SCCollectionProtocol >) copyObject

Returns the copy of receiver's instance.

Returns:
Copy of receiver's instance
- (NSDictionary *) dataDictionary

Returns the dictionary with the receiver's number.

Returns:
Dictionary with the receiver's string
- (id) initWithByte: (SCByte byte

Initializes the number using the specified signed 8-bit integer.

Parameters:
byte- source signed 8-bit integer
Returns:
A newly initialized number
- (id) initWithContentsOfSerializedFile: (NSString *)  path

Initializes the number using the contens of serialized file with the specified path.

Parameters:
path- source serialized file path
Returns:
A newly initialized number
- (id) initWithDataDictionary: (NSDictionary *)  dictionary

Initializes the number using the specified dictionary.

Parameters:
dictionary- source dictionary
Returns:
A newly initialized number
Exceptions:
SCNumberException- unsupported NSNumber type
- (id) initWithDataDictionaryFromFile: (NSString *)  path

Initializes the number using the dictionary from the specified file.

Parameters:
path- source dictionary file path
Returns:
A newly initialized number
Exceptions:
SCNumberException- unsupported NSNumber type
- (id) initWithFileStream: (NSString *)  path

Initializes the number from the stream file with the specified path.

Parameters:
path- stream file path
Returns:
A newly initialized number
Exceptions:
SCStreamException- stream operation error detected
- (id) initWithNumber: (NSNumber *)  number

Initializes the number using the specified existing number.

Parameters:
number- existing number
Returns:
A newly initialized number
- (id) initWithStream: (SCStream *)  stream

Initializes the number from the specified stream.

Parameters:
stream- stream for reading number
Returns:
A newly initialized number
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (id) initWithUnsignedByte: (SCUByte byte

Initializes the number using the specified unsigned 8-bit integer.

Parameters:
byte- source signed 8-bit integer
Returns:
A newly initialized number
- (BOOL) isEqualToBool: (BOOL)  boolean

Compares the reciver's number with the specified boolean variable.

Parameters:
boolean- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToByte: (SCByte byte

Compares the receiver's number with the signed 8-bit integer variable.

Parameters:
byte- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToChar: (char)  chr

Compares the reciver's number with the specified char variable.

Parameters:
chr- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToDouble: (SCDouble dbl

Compares the receiver's number with the specified double precision float variable.

Parameters:
dbl- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToFloat: (SCFloat flt

Compares the receiver's number with the specified single precision float variable.

Parameters:
flt- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToInt: (SCInteger integer

Compares the receiver's number with the signed 32-bit integer variable.

Parameters:
integer- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToLongLong: (SCLong longint

Compares the receiver's number with the signed 64-bit integer variable.

Parameters:
longint- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToShort: (SCShort sht

Compares the receiver's number with the signed 16-bit integer variable.

Parameters:
sht- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToUnsignedByte: (SCUByte byte

Compares the receiver's number with the unsigned 8-bit integer variable.

Parameters:
byte- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToUnsignedInt: (SCUInteger integer

Compares the receiver's number with the unsigned 32-bit integer variable.

Parameters:
integer- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToUnsignedLongLong: (SCULong longint

Compares the receiver's number with the unsigned 64-bit integer variable.

Parameters:
longint- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
- (BOOL) isEqualToUnsignedShort: (SCUShort sht

Compares the receiver's number with the unsigned 16-bit integer variable.

Parameters:
sht- variable to compare
Returns:
YES if the number is equal to the variable, otherwise NO
+ (NSNumber *) numberWithByte: (SCByte byte

Returns the number created by using the specified signed 8-bit integer.

Parameters:
byte- source signed 8-bit integer
Returns:
A created number
+ (NSNumber *) numberWithContentsOfSerializedFile: (NSString *)  path

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

Parameters:
path- source serialized file path
Returns:
A created number
+ (NSNumber *) numberWithDataDictionary: (NSDictionary *)  dictionary

Returns a number created by using the specified dictionary.

Parameters:
dictionary- source dictionary
Returns:
A created number
Exceptions:
SCNumberException- unsupported NSNumber type
+ (NSNumber *) numberWithDataDictionaryFromFile: (NSString *)  path

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

Parameters:
path- source dictionary file path
Returns:
A created number
Exceptions:
SCNumberException- unsupported NSNumber type
+ (NSNumber *) numberWithFileStream: (NSString *)  path

Returns the number created from the stream file with the specified path.

Parameters:
path- stream file path
Returns:
A created number
Exceptions:
SCStreamException- stream operation error detected
+ (NSNumber *) numberWithNumber: (NSNumber *)  number

Returns the number created by using the specified existing number.

Parameters:
number- existing number
Returns:
A created number
+ (NSNumber *) numberWithStream: (SCStream *)  stream

Returns the number created from the specified stream.

Parameters:
stream- stream for reading number
Returns:
A created number
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
+ (NSNumber *) numberWithUnsignedByte: (SCUByte byte

Returns the number created by using the specified signed 8-bit integer.

Parameters:
byte- source signed 8-bit integer
Returns:
A created number
- (SCStandardType) type

Returns the number data type.

Returns:
Number data type
- (SCUByte) unsignedByteValue

Returns the unsigned 8-bit integer representation of the receiver's number.

Returns:
Unsigned 8-bit integer representation
- (BOOL) writeContentsToSerializedFile: (NSString *)  path

Writes receiver's encoded number into the serialized file with the specified path.

Parameters:
path- path at which to write the file
Returns:
YES if operation is successfully, otherwise NO
- (void) writeToDataDictionary: (NSMutableDictionary *)  dictionary

Writes the receiver's number into the specified dictionary.

Parameters:
dictionary- destination dictionary
- (void) writeToDataDictionaryFile: (NSString *)  path

Atomically writes the receiver's number into the dictionary file with the specified path.

Parameters:
path- path at which to write the file
- (void) writeToDataDictionaryFile: (NSString *)  path
atomically: (BOOL)  atomically 

Writes the receiver's number into the dictionary file with the specified path.

Parameters:
path- path at which to write the file
atomically- YES for writing data to an auxiliary file, and then the auxiliary file is renamed to path, NO for writing data directly to path
- (void) writeToFileStream: (NSString *)  path

Saves the receiver's number instance to the created stream file with the specified path.

Parameters:
path- stream file path
Exceptions:
SCStreamException- stream operation error detected
- (void) writeToStream: (SCStream *)  stream

Saves the receiver's number to the specified stream.

Parameters:
stream- stream for writing receiver's number
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

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