Samond Classes Library 1.2.6-STABLE build 219
List of all members
NSNumber(SCNumber) Category Reference

Standard class NSNumber functionality extending category. More...

#import <NSNumber+SCNumber.h>

Creating Numbers

(instancetype) + numberWithCoder:
 
(instancetype) + numberWithContentsOfSerializedFile:
 
(instancetype) + numberWithDataDictionary:
 
(instancetype) + numberWithDataDictionaryFromFile:
 
(instancetype) + numberWithStream:
 
(instancetype) + numberWithFileStream:
 
(instancetype) + numberWithData:
 
(instancetype) + numberWithContentsOfFile:
 
(instancetype) + numberWithContentsOfURL:
 
(instancetype) + numberWithContentsOfURLString:
 
(instancetype) + numberWithNumber:
 
(instancetype) + numberWithByte:
 
(instancetype) + numberWithUnsignedByte:
 
(instancetype) + numberWithUnichar:
 
(instancetype) + numberWithBinaryString:
 
(instancetype) + numberWithOctalString:
 
(instancetype) + numberWithDecimalString:
 
(instancetype) + numberWithHexadecimalString:
 
(instancetype) + numberWithString:
 
(instancetype) + numberWithBoolString:
 
(instancetype) + numberWithFloatString:
 
(instancetype) + numberWithDoubleString:
 

Initializing Numbers

(instancetype) - initWithNumber:
 
(instancetype) - initWithByte:
 
(instancetype) - initWithUnsignedByte:
 
(instancetype) - initWithUnichar:
 
(instancetype) - initWithBinaryString:
 
(instancetype) - initWithOctalString:
 
(instancetype) - initWithDecimalString:
 
(instancetype) - initWithHexadecimalString:
 
(instancetype) - initWithString:
 
(instancetype) - initWithBoolString:
 
(instancetype) - initWithFloatString:
 
(instancetype) - initWithDoubleString:
 

Instance Properties

SCByte byteValue
 
SCUByte unsignedByteValue
 
unichar unicharValue
 
NSString * binaryString
 
NSString * octalString
 
NSString * decimalString
 
NSString * string
 
NSString * hexadecimalString
 
NSString * boolString
 
NSString * floatString
 
NSString * doubleString
 

Number Type Detection

SCDataType type
 

Comparing Numbers

(BOOL) - isEqualToByte:
 
(BOOL) - isEqualToUnsignedByte:
 
(BOOL) - isEqualToShort:
 
(BOOL) - isEqualToUnsignedShort:
 
(BOOL) - isEqualToInteger:
 
(BOOL) - isEqualToUnsignedInteger:
 
(BOOL) - isEqualToLongLong:
 
(BOOL) - isEqualToUnsignedLongLong:
 
(BOOL) - isEqualToChar:
 
(BOOL) - isEqualToUnichar:
 
(BOOL) - isEqualToBool:
 
(BOOL) - isEqualToFloat:
 
(BOOL) - isEqualToDouble:
 

Comparing Numbers and Strings

(BOOL) - isEqualToBinaryString:
 
(BOOL) - isEqualToOctalString:
 
(BOOL) - isEqualToDecimalString:
 
(BOOL) - isEqualToHexadecimalString:
 
(BOOL) - isEqualToString:
 
(BOOL) - isEqualToBoolString:
 
(BOOL) - isEqualToFloatString:
 
(BOOL) - isEqualToDoubleString:
 

Detailed Description

Standard class NSNumber functionality extending category.

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

Declares the additional properties and methods for add into the standard class NSNumber the enhanced functionality.
Category methods can be throwing the following exceptions:

Method Documentation

- (instancetype) initWithBinaryString: (NSString *)  string

Initializes a number using a given string with the binary representation of the integer value.

Parameters
string- the string with the binary representation of the integer value
Returns
A newly initialized number
- (instancetype) initWithBoolString: (NSString *)  string

Initializes a number using a given string with the text representation of the boolean value.

Parameters
string- the string with the text representation of the boolean value
Returns
A newly initialized number
- (instancetype) initWithByte: (SCByte byte

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

Parameters
byte- the source value
Returns
A newly initialized number
- (instancetype) initWithDecimalString: (NSString *)  string

Initializes a number using a given string with the decimal representation of the integer value.

Parameters
string- the string with the decimal representation of the integer value
Returns
A newly initialized number
See also
- initWithString:
- (instancetype) initWithDoubleString: (NSString *)  string

Initializes a number using a given string with the text representation of the double value.

Parameters
string- the string with the text representation of the double value
Returns
A newly initialized number
- (instancetype) initWithFloatString: (NSString *)  string

Initializes a number using a given string with the text representation of the float value.

Parameters
string- the string with the text representation of the float value
Returns
A newly initialized number
- (instancetype) initWithHexadecimalString: (NSString *)  string

Initializes a number using a given string with the hexadecimal representation of the integer value.

Parameters
string- the string with the hexadecimal representation of the integer value
Returns
A newly initialized number
- (instancetype) initWithNumber: (NSNumber *)  number

Returns a number initialized by copying the data from another given number.

Parameters
number- the number from which to copy data
Returns
A newly initialized number
- (instancetype) initWithOctalString: (NSString *)  string

Initializes a number using a given string with the octal representation of the integer value.

Parameters
string- the string with the binary representation of the integer value
Returns
A newly initialized number
- (instancetype) initWithString: (NSString *)  string

Initializes a number using a given string with the decimal representation of the integer value.

Parameters
string- the string with the decimal representation of the integer value
Returns
A newly initialized number
See also
- initWithDecimalString:
- (instancetype) initWithUnichar: (unichar)  chr

Initializes a number using the specified character.

Parameters
chr- the source character
Returns
A newly initialized number
- (instancetype) initWithUnsignedByte: (SCUByte byte

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

Parameters
byte- the source value
Returns
A newly initialized number
- (BOOL) isEqualToBinaryString: (NSString *)  string

Returns a boolean value that indicates whether the receiving number is equal to a given string with the binary representation of the integer value.

Parameters
string- the string with the binary representation of the integer value
Returns
YES if the receiving number is equal to a string with the binary representation, otherwise NO
- (BOOL) isEqualToBool: (BOOL)  value

Returns a boolean value that indicates whether the receiving number is equal to a given boolean value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToBoolString: (NSString *)  string

Returns a boolean value that indicates whether the receiving number is equal to a given string with the text representation of the boolean value.

Parameters
string- the string with the text representation of the boolean value
Returns
YES if the receiving number is equal to a string with the text representation, otherwise NO
- (BOOL) isEqualToByte: (SCByte value

Returns a boolean value that indicates whether the receiving number is equal to a given 8-bit signed integer value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToChar: (char)  value

Returns a boolean value that indicates whether the receiving number is equal to a given character.

Parameters
value- the character to compare with the receiving number
Returns
YES if the receiving number is equal to a given character, otherwise NO
See also
- isEqualToUnichar:
- (BOOL) isEqualToDecimalString: (NSString *)  string

Returns a boolean value that indicates whether the receiving number is equal to a given string with the decimal representation of the integer value.

Parameters
string- the string with the decimal representation of the integer value
Returns
YES if the receiving number is equal to a string with the decimal representation, otherwise NO
See also
- isEqualToString:
- (BOOL) isEqualToDouble: (SCDouble value

Returns a boolean value that indicates whether the receiving number is equal to a given double value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToDoubleString: (NSString *)  string

Returns a boolean value that indicates whether the receiving number is equal to a given string with the text representation of the double value.

Parameters
string- the string with the text representation of the double value
Returns
YES if the receiving number is equal to a string with the text representation, otherwise NO
- (BOOL) isEqualToFloat: (SCFloat value

Returns a boolean value that indicates whether the receiving number is equal to a given float value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToFloatString: (NSString *)  string

Returns a boolean value that indicates whether the receiving number is equal to a given string with the text representation of the float value.

Parameters
string- the string with the text representation of the float value
Returns
YES if the receiving number is equal to a string with the text representation, otherwise NO
- (BOOL) isEqualToHexadecimalString: (NSString *)  string

Returns a boolean value that indicates whether the receiving number is equal to a given string with the hexadecimal representation of the integer value.

Parameters
string- the string with the hexadecimal representation of the integer value
Returns
YES if the receiving number is equal to a string with the hexadecimal representation, otherwise NO
- (BOOL) isEqualToInteger: (SCInteger value

Returns a boolean value that indicates whether the receiving number is equal to a given 32-bit signed integer value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToLongLong: (SCLong value

Returns a boolean value that indicates whether the receiving number is equal to a given 64-bit signed integer value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToOctalString: (NSString *)  string

Returns a boolean value that indicates whether the receiving number is equal to a given string with the octal representation of the integer value.

Parameters
string- the string with the octal representation of the integer value
Returns
YES if the receiving number is equal to a string with the octal representation, otherwise NO
- (BOOL) isEqualToShort: (SCShort value

Returns a boolean value that indicates whether the receiving number is equal to a given 16-bit signed integer value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToString: (NSString *)  string

Returns a boolean value that indicates whether the receiving number is equal to a given string with the decimal representation of the integer value.

Parameters
string- the string with the decimal representation of the integer value
Returns
YES if the receiving number is equal to a string with the decimal representation, otherwise NO
See also
- isEqualToDecimalString:
- (BOOL) isEqualToUnichar: (unichar)  value

Returns a boolean value that indicates whether the receiving number is equal to a given character.

Parameters
value- the character to compare with the receiving number
Returns
YES if the receiving number is equal to a given character, otherwise NO
See also
- isEqualToChar:
- (BOOL) isEqualToUnsignedByte: (SCUByte value

Returns a boolean value that indicates whether the receiving number is equal to a given 8-bit unsigned integer value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToUnsignedInteger: (SCUInteger value

Returns a boolean value that indicates whether the receiving number is equal to a given 32-bit unsigned integer value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToUnsignedLongLong: (SCULong value

Returns a boolean value that indicates whether the receiving number is equal to a given 64-bit unsigned integer value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
- (BOOL) isEqualToUnsignedShort: (SCUShort value

Returns a boolean value that indicates whether the receiving number is equal to a given 16-bit unsigned integer value.

Parameters
value- the value to compare with the receiving number
Returns
YES if the receiving number is equal to a given value, otherwise NO
+ (instancetype) numberWithBinaryString: (NSString *)  string

Returns a number created by using a given string with the binary representation of the integer value.

Parameters
string- the string with the binary representation of the integer value
Returns
A created number
+ (instancetype) numberWithBoolString: (NSString *)  string

Returns a number created by using a given string with the text representation of the boolean value.

Parameters
string- the strig with the text representation of the boolean value
Returns
A created number
+ (instancetype) numberWithByte: (SCByte byte

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

Parameters
byte- the source value
Returns
A created number
+ (instancetype) numberWithCoder: (NSCoder *)  coder

Returns a number created by using the data from the specified coder.

Parameters
coder- the source coder
Returns
A created number
+ (instancetype) numberWithContentsOfFile: (NSString *)  path

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

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

Returns a number created by using the data from the serialized file with the specified path.

Parameters
path- the path to the serialized file
Returns
A created number
+ (instancetype) numberWithContentsOfURL: (NSURL *)  url

Returns a number created by using the specified URL.

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

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

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

Returns a number created by using the specified data object.

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

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

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

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

Parameters
path- the path to the source dictionary file
Returns
A created number
Exceptions
SCNumberException- unsupported number type detected
+ (instancetype) numberWithDecimalString: (NSString *)  string

Returns a number created by using a given string with the decimal representation of the integer value.

Parameters
string- the string with the decimal representation of the integer value
Returns
A created number
See also
+ numberWithString:
+ (instancetype) numberWithDoubleString: (NSString *)  string

Returns a number created by using a given string with the text representation of the double value.

Parameters
string- the string with the text representation of the double value
Returns
A created number
+ (instancetype) numberWithFileStream: (NSString *)  path

Returns a number 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 number
Exceptions
SCStreamException- stream error detected
SCSystemException- system error detected
+ (instancetype) numberWithFloatString: (NSString *)  string

Returns a number created by using a given string with the text representation of the float value.

Parameters
string- the string with the text representation of the float value
Returns
A created number
+ (instancetype) numberWithHexadecimalString: (NSString *)  string

Returns a number created by using a given string with the hexadecimal representation of the integer value.

Parameters
string- the string with the hexadecimal representation of the integer value
Returns
A created number
+ (instancetype) numberWithNumber: (NSNumber *)  number

Returns a number created by using the specified existing number.

Parameters
number- the source number.
Returns
A created number
+ (instancetype) numberWithOctalString: (NSString *)  string

Returns a number created by using a given string with the octal representation of the integer value.

Parameters
string- the string with the octal representation of the integer value
Returns
A created number
+ (instancetype) numberWithStream: (SCStream *)  stream

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

Parameters
stream- the source stream
Returns
A created number
Exceptions
SCStreamException- stream error detected
SCSystemException- system error detected
SCNumberException- unsupported number type detected
+ (instancetype) numberWithString: (NSString *)  string

Returns a number created by using a given string with the decimal representation of the integer value.

Parameters
string- the string with the decimal representation of the integer value
Returns
A created number
See also
+ numberWithDecimalString:
+ (instancetype) numberWithUnichar: (unichar)  chr

Returns a number created by using the specified character.

Parameters
chr- the source character
Returns
A created number
+ (instancetype) numberWithUnsignedByte: (SCUByte byte

Returns a number created by using the specified 8-bit unsigned integer value.

Parameters
byte- the source value
Returns
A created number

Property Documentation

- (NSString *) binaryString
readnonatomicassign

The string with the binary representation of the receiving number

- (NSString *) boolString
readnonatomicassign

The string with the text representation of the receiving number as a boolean value

- (SCByte) byteValue
readnonatomicassign

The number value expressed as a 8-bit signed integer value

- (NSString *) decimalString
readnonatomicassign

The string with the decimal representation of the receiving number

See also
string
- (NSString *) doubleString
readnonatomicassign

The string with the text representation of the receiving number as a double value

- (NSString *) floatString
readnonatomicassign

The string with the text representation of the receiving number as a float value

- (NSString *) hexadecimalString
readnonatomicassign

The string with the hexadecimal representation of the receiving number

- (NSString *) octalString
readnonatomicassign

The string with the octal representation of the receiving number

- (NSString *) string
readnonatomicassign

The string with the decimal representation of the receiving number

See also
decimalString
- (SCDataType) type
readnonatomicassign

A type of the receiving number

- (unichar) unicharValue
readnonatomicassign

The number value expressed as a character

- (SCUByte) unsignedByteValue
readnonatomicassign

The number value expressed as a 8-bit unsigned integer value


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