Public Member Functions | Static Public Member Functions | Protected Attributes

OFNumber Class Reference

Provides a way to store a number in an object. More...

#import <OFNumber.h>

Inheritance diagram for OFNumber:
OFObject <OFCopying>

List of all members.

Public Member Functions

(id) - initWithBool:
(id) - initWithChar:
(id) - initWithShort:
(id) - initWithInt:
(id) - initWithLong:
(id) - initWithUnsignedChar:
(id) - initWithUnsignedShort:
(id) - initWithUnsignedInt:
(id) - initWithUnsignedLong:
(id) - initWithInt8:
(id) - initWithInt16:
(id) - initWithInt32:
(id) - initWithInt64:
(id) - initWithUInt8:
(id) - initWithUInt16:
(id) - initWithUInt32:
(id) - initWithUInt64:
(id) - initWithSize:
(id) - initWithSSize:
(id) - initWithIntMax:
(id) - initWithUIntMax:
(id) - initWithPtrDiff:
(id) - initWithIntPtr:
(id) - initWithUIntPtr:
(id) - initWithFloat:
(id) - initWithDouble:
(enum of_number_type) - type
(BOOL) - boolValue
(char) - charValue
(short) - shortValue
(int) - intValue
(long) - longValue
(unsigned char) - unsignedCharValue
(unsigned short) - unsignedShortValue
(unsigned int) - unsignedIntValue
(unsigned long) - unsignedLongValue
(int8_t) - int8Value
(int16_t) - int16Value
(int32_t) - int32Value
(int64_t) - int64Value
(uint8_t) - uInt8Value
(uint16_t) - uInt16Value
(uint32_t) - uInt32Value
(uint64_t) - uInt64Value
(size_t) - sizeValue
(ssize_t) - sSizeValue
(intmax_t) - intMaxValue
(uintmax_t) - uIntMaxValue
(ptrdiff_t) - ptrDiffValue
(intptr_t) - intPtrValue
(uintptr_t) - uIntPtrValue
(float) - floatValue
(double) - doubleValue
(OFNumber *) - numberByAddingNumber:
(OFNumber *) - numberBySubtractingNumber:
(OFNumber *) - numberByMultiplyingWithNumber:
(OFNumber *) - numberByDividingWithNumber:
(OFNumber *) - numberByANDingWithNumber:
(OFNumber *) - numberByORingWithNumber:
(OFNumber *) - numberByXORingWithNumber:
(OFNumber *) - numberByShiftingLeftWithNumber:
(OFNumber *) - numberByShiftingRightWithNumber:
(OFNumber *) - numberByIncreasing
(OFNumber *) - numberByDecreasing
(OFNumber *) - remainderOfDivisionWithNumber:

Static Public Member Functions

(id) + numberWithBool:
(id) + numberWithChar:
(id) + numberWithShort:
(id) + numberWithInt:
(id) + numberWithLong:
(id) + numberWithUnsignedChar:
(id) + numberWithUnsignedShort:
(id) + numberWithUnsignedInt:
(id) + numberWithUnsignedLong:
(id) + numberWithInt8:
(id) + numberWithInt16:
(id) + numberWithInt32:
(id) + numberWithInt64:
(id) + numberWithUInt8:
(id) + numberWithUInt16:
(id) + numberWithUInt32:
(id) + numberWithUInt64:
(id) + numberWithSize:
(id) + numberWithSSize:
(id) + numberWithIntMax:
(id) + numberWithUIntMax:
(id) + numberWithPtrDiff:
(id) + numberWithIntPtr:
(id) + numberWithUIntPtr:
(id) + numberWithFloat:
(id) + numberWithDouble:

Protected Attributes

union {
   BOOL   bool_
   char   char_
   short   short_
   int   int_
   long   long_
   unsigned char   uchar
   unsigned short   ushort
   unsigned int   uint
   unsigned long   ulong
   int8_t   int8
   int16_t   int16
   int32_t   int32
   int64_t   int64
   uint8_t   uint8
   uint16_t   uint16
   uint32_t   uint32
   uint64_t   uint64
   size_t   size
   ssize_t   ssize
   intmax_t   intmax
   uintmax_t   uintmax
   ptrdiff_t   ptrdiff
   intptr_t   intptr
   uintptr_t   uintptr
   float   float_
   double   double_
value
enum of_number_type type

Detailed Description

Provides a way to store a number in an object.


Member Function Documentation

- (BOOL) boolValue  
Returns:
The OFNumber as a BOOL
- (char) charValue  
Returns:
The OFNumber as a char
- (double) doubleValue  
Returns:
The OFNumber as a double
- (float) floatValue  
Returns:
The OFNumber as a float
- (id) initWithBool: (BOOL)  bool_  

Initializes an already allocated OFNumber with the specified BOOL.

Parameters:
bool_ A BOOL which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithChar: (char)  char_  

Initializes an already allocated OFNumber with the specified char.

Parameters:
char_ A char which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithDouble: (double)  double_  

Initializes an already allocated OFNumber with the specified double.

Parameters:
double_ A double which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithFloat: (float)  float_  

Initializes an already allocated OFNumber with the specified float.

Parameters:
float_ A float which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithInt16: (int16_t)  int16  

Initializes an already allocated OFNumber with the specified int16_t.

Parameters:
int16 An int16_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithInt32: (int32_t)  int32  

Initializes an already allocated OFNumber with the specified int32_t.

Parameters:
int32 An int32_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithInt64: (int64_t)  int64  

Initializes an already allocated OFNumber with the specified int64_t.

Parameters:
int64 An int64_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithInt8: (int8_t)  int8  

Initializes an already allocated OFNumber with the specified int8_t.

Parameters:
int8 An int8_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithInt: (int)  int_  

Initializes an already allocated OFNumber with the specified int.

Parameters:
int_ An int which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithIntMax: (intmax_t)  intmax  

Initializes an already allocated OFNumber with the specified intmax_t.

Parameters:
intmax An intmax_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithIntPtr: (intptr_t)  intptr  

Initializes an already allocated OFNumber with the specified intptr_t.

Parameters:
intptr An intptr_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithLong: (long)  long_  

Initializes an already allocated OFNumber with the specified long.

Parameters:
long_ A long which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithPtrDiff: (ptrdiff_t)  ptrdiff  

Initializes an already allocated OFNumber with the specified ptrdiff_t.

Parameters:
ptrdiff A ptrdiff_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithShort: (short)  short_  

Initializes an already allocated OFNumber with the specified short.

Parameters:
short_ A short which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithSize: (size_t)  size  

Initializes an already allocated OFNumber with the specified size_t.

Parameters:
size A size_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithSSize: (ssize_t)  ssize  

Initializes an already allocated OFNumber with the specified ssize_t.

Parameters:
ssize An ssize_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUInt16: (uint16_t)  uint16  

Initializes an already allocated OFNumber with the specified uint16_t.

Parameters:
uint16 A uint16_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUInt32: (uint32_t)  uint32  

Initializes an already allocated OFNumber with the specified uint32_t.

Parameters:
uint32 A uint32_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUInt64: (uint64_t)  uint64  

Initializes an already allocated OFNumber with the specified uint64_t.

Parameters:
uint64 A uint64_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUInt8: (uint8_t)  uint8  

Initializes an already allocated OFNumber with the specified uint8_t.

Parameters:
uint8 A uint8_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUIntMax: (uintmax_t)  uintmax  

Initializes an already allocated OFNumber with the specified uintmax_t.

Parameters:
uintmax A uintmax_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUIntPtr: (uintptr_t)  uintptr  

Initializes an already allocated OFNumber with the specified uintptr_t.

Parameters:
uintptr A uintptr_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUnsignedChar: (unsigned char)  uchar  

Initializes an already allocated OFNumber with the specified unsigned char.

Parameters:
uchar An unsigned char which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUnsignedInt: (unsigned int)  uint  

Initializes an already allocated OFNumber with the specified unsigned int .

Parameters:
uint An unsigned int which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUnsignedLong: (unsigned long)  ulong  

Initializes an already allocated OFNumber with the specified unsigned long.

Parameters:
ulong An unsigned long which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUnsignedShort: (unsigned short)  ushort  

Initializes an already allocated OFNumber with the specified unsigned short.

Parameters:
ushort An unsigned short which the OFNumber should contain
Returns:
An initialized OFNumber
- (int16_t) int16Value  
Returns:
The OFNumber as an int16_t
- (int32_t) int32Value  
Returns:
The OFNumber as an int32_t
- (int64_t) int64Value  
Returns:
The OFNumber as an int64_t
- (int8_t) int8Value  
Returns:
The OFNumber as an int8_t
- (intmax_t) intMaxValue  
Returns:
The OFNumber as an intmax_t
- (intptr_t) intPtrValue  
Returns:
The OFNumber as an intptr_t
- (int) intValue  
Returns:
The OFNumber as an int
- (long) longValue  
Returns:
The OFNumber as a long
- (OFNumber *) numberByAddingNumber: (OFNumber*)  num  
Parameters:
num The OFNumber to add
Returns:
A new autoreleased OFNumber added with the specified OFNumber
- (OFNumber *) numberByANDingWithNumber: (OFNumber*)  num  

ANDs two OFNumbers, returning a new one.

Does not work with floating point types!

Parameters:
num The number to AND with.
Returns:
A new autoreleased OFNumber ANDed with the specified OFNumber
- (OFNumber *) numberByDecreasing  
Returns:
A new autoreleased OFNumber with the value decreased by one.
- (OFNumber *) numberByDividingWithNumber: (OFNumber*)  num  
Parameters:
num The OFNumber to divide by
Returns:
A new autoreleased OFNumber devided by the specified OFNumber
- (OFNumber *) numberByIncreasing  
Returns:
A new autoreleased OFNumber with the value increased by one.
- (OFNumber *) numberByMultiplyingWithNumber: (OFNumber*)  num  
Parameters:
num The OFNumber to multiply with
Returns:
A new autoreleased OFNumber multiplied with the specified OFNumber
- (OFNumber *) numberByORingWithNumber: (OFNumber*)  num  

ORs two OFNumbers, returning a new one.

Does not work with floating point types!

Parameters:
num The number to OR with.
Returns:
A new autoreleased OFNumber ORed with the specified OFNumber
- (OFNumber *) numberByShiftingLeftWithNumber: (OFNumber*)  num  

Bitshifts the OFNumber to the left by the specified OFNumber, returning a new one.

Does not work with floating point types!

Parameters:
num The number of bits to shift to the left
Returns:
A new autoreleased OFNumber bitshifted to the left with the specified OFNumber
- (OFNumber *) numberByShiftingRightWithNumber: (OFNumber*)  num  

Bitshifts the OFNumber to the right by the specified OFNumber, returning a new one.

Does not work with floating point types!

Parameters:
num The number of bits to shift to the right
Returns:
A new autoreleased OFNumber bitshifted to the right with the specified OFNumber
- (OFNumber *) numberBySubtractingNumber: (OFNumber*)  num  
Parameters:
num The OFNumber to substract
Returns:
A new autoreleased OFNumber subtracted by the specified OFNumber
- (OFNumber *) numberByXORingWithNumber: (OFNumber*)  num  

XORs two OFNumbers, returning a new one.

Does not work with floating point types!

Parameters:
num The number to XOR with.
Returns:
A new autoreleased OFNumber XORed with the specified OFNumber
+ (id) numberWithBool: (BOOL)  bool_  
Parameters:
bool_ A BOOL which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithChar: (char)  char_  
Parameters:
char_ A char which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithDouble: (double)  double_  
Parameters:
double_ A double which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithFloat: (float)  float_  
Parameters:
float_ A float which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithInt16: (int16_t)  int16  
Parameters:
int16 An int16_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithInt32: (int32_t)  int32  
Parameters:
int32 An int32_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithInt64: (int64_t)  int64  
Parameters:
int64 An int64_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithInt8: (int8_t)  int8  
Parameters:
int8 An int8_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithInt: (int)  int_  
Parameters:
int_ An int which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithIntMax: (intmax_t)  intmax  
Parameters:
intmax An intmax_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithIntPtr: (intptr_t)  intptr  
Parameters:
intptr An intptr_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithLong: (long)  long_  
Parameters:
long_ A long which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithPtrDiff: (ptrdiff_t)  ptrdiff  
Parameters:
ptrdiff A ptrdiff_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithShort: (short)  short_  
Parameters:
short_ A short which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithSize: (size_t)  size  
Parameters:
size A size_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithSSize: (ssize_t)  ssize  
Parameters:
ssize An ssize_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt16: (uint16_t)  uint16  
Parameters:
uint16 A uint16_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt32: (uint32_t)  uint32  
Parameters:
uint32 A uint32_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt64: (uint64_t)  uint64  
Parameters:
uint64 A uint64_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt8: (uint8_t)  uint8  
Parameters:
uint8 A uint8_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUIntMax: (uintmax_t)  uintmax  
Parameters:
uintmax A uintmax_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUIntPtr: (uintptr_t)  uintptr  
Parameters:
uintptr A uintptr_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUnsignedChar: (unsigned char)  uchar  
Parameters:
uchar An unsigned char which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUnsignedInt: (unsigned int)  uint  
Parameters:
uint An unsigned int which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUnsignedLong: (unsigned long)  ulong  
Parameters:
ulong An unsigned long which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUnsignedShort: (unsigned short)  ushort  
Parameters:
ushort An unsigned short which the OFNumber should contain
Returns:
A new autoreleased OFNumber
- (ptrdiff_t) ptrDiffValue  
Returns:
The OFNumber as a ptrdiff_t
- (OFNumber *) remainderOfDivisionWithNumber: (OFNumber*)  num  
Parameters:
num The number to divide by
Returns:
The remainder of a division by the specified number
- (short) shortValue  
Returns:
The OFNumber as a short
- (size_t) sizeValue  
Returns:
The OFNumber as a size_t
- (ssize_t) sSizeValue  
Returns:
The OFNumber as an ssize_t
- (enum of_number_type) type  
Returns:
An enum of type of_number_type indicating the type of contained number of the OFNumber
- (uint16_t) uInt16Value  
Returns:
The OFNumber as a uint16_t
- (uint32_t) uInt32Value  
Returns:
The OFNumber as a uint32_t
- (uint64_t) uInt64Value  
Returns:
The OFNumber as a uint64_t
- (uint8_t) uInt8Value  
Returns:
The OFNumber as a uint8_t
- (uintmax_t) uIntMaxValue  
Returns:
The OFNumber as a uintmax_t
- (uintptr_t) uIntPtrValue  
Returns:
The OFNumber as a uintptr_t
- (unsigned char) unsignedCharValue  
Returns:
The OFNumber as an unsigned char
- (unsigned int) unsignedIntValue  
Returns:
The OFNumber as an unsigned int
- (unsigned long) unsignedLongValue  
Returns:
The OFNumber as an unsigned long
- (unsigned short) unsignedShortValue  
Returns:
The OFNumber as an unsigned short

The documentation for this class was generated from the following files:
 All Classes Functions Variables