OFNumber Class Reference

#import <OFNumber.h>

Inheritance diagram for OFNumber:
OFObject

List of all members.

Public Member Functions

(id) - initWithChar:
(id) - initWithShort:
(id) - initWithInt:
(id) - initWithLong:
(id) - initWithUChar:
(id) - initWithUShort:
(id) - initWithUInt:
(id) - initWithULong:
(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) - initWithFloat:
(id) - initWithDouble:
(enum of_number_type) - type
(char) - asChar
(short) - asShort
(int) - asInt
(long) - asLong
(unsigned char) - asUChar
(unsigned short) - asUShort
(unsigned int) - asUInt
(unsigned long) - asULong
(int8_t) - asInt8
(int16_t) - asInt16
(int32_t) - asInt32
(int64_t) - asInt64
(uint8_t) - asUInt8
(uint16_t) - asUInt16
(uint32_t) - asUInt32
(uint64_t) - asUInt64
(size_t) - asSize
(ssize_t) - asSSize
(intmax_t) - asIntMax
(uintmax_t) - asUIntMax
(ptrdiff_t) - asPtrDiff
(intptr_t) - asIntPtr
(float) - asFloat
(double) - asDouble
(id) - add:
(id) - subtract:
(id) - multiplyWith:
(id) - divideBy:
(id) - increase
(id) - decrease

Static Public Member Functions

(id) + numberWithChar:
(id) + numberWithShort:
(id) + numberWithInt:
(id) + numberWithLong:
(id) + numberWithUChar:
(id) + numberWithUShort:
(id) + numberWithUInt:
(id) + numberWithULong:
(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) + numberWithFloat:
(id) + numberWithDouble:

Protected Attributes

union {
   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
   float   float_
   double   double_
value
enum of_number_type type

Detailed Description

The OFNumber class provides a way to store a number in an object and to manipulate it.


Member Function Documentation

- (id) add: (OFNumber*)  num  

Adds the specified OFNumber to the OFNumber.

Parameters:
num The OFNumber to add
- (char) asChar  
Returns:
The OFNumber as a char
- (double) asDouble  
Returns:
The OFNumber as a double
- (float) asFloat  
Returns:
The OFNumber as a float
- (int) asInt  
Returns:
The OFNumber as an int
- (int16_t) asInt16  
Returns:
The OFNumber as an int16_t
- (int32_t) asInt32  
Returns:
The OFNumber as an int32_t
- (int64_t) asInt64  
Returns:
The OFNumber as an int64_t
- (int8_t) asInt8  
Returns:
The OFNumber as an int8_t
- (intmax_t) asIntMax  
Returns:
The OFNumber as an intmax_t
- (intptr_t) asIntPtr  
Returns:
The OFNumber as an intptr_t
- (long) asLong  
Returns:
The OFNumber as a long
- (ptrdiff_t) asPtrDiff  
Returns:
The OFNumber as a ptrdiff_t
- (short) asShort  
Returns:
The OFNumber as a short
- (size_t) asSize  
Returns:
The OFNumber as a size_t
- (ssize_t) asSSize  
Returns:
The OFNumber as an ssize_t
- (unsigned char) asUChar  
Returns:
The OFNumber as an unsigned char
- (unsigned int) asUInt  
Returns:
The OFNumber as an unsigned int
- (uint16_t) asUInt16  
Returns:
The OFNumber as an uint16_t
- (uint32_t) asUInt32  
Returns:
The OFNumber as an uint32_t
- (uint64_t) asUInt64  
Returns:
The OFNumber as an uint64_t
- (uint8_t) asUInt8  
Returns:
The OFNumber as an uint8_t
- (uintmax_t) asUIntMax  
Returns:
The OFNumber as an uintmax_t
- (unsigned long) asULong  
Returns:
The OFNumber as an unsigned long
- (unsigned short) asUShort  
Returns:
The OFNumber as an unsigned short
- (id) decrease  

Decreases the OFNumber by 1.

- (id) divideBy: (OFNumber*)  num  

Divides the OFNumber by the specified OFNumber.

Parameters:
num The OFNumber to divide by
- (id) increase  

Increases the OFNumber by 1.

- (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) initWithUChar: (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) initWithUInt16: (uint16_t)  uint16  

Initializes an already allocated OFNumber with the specified uint16_t.

Parameters:
uint16 An 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 An 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 An 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 An uint8_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithUInt: (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) initWithUIntMax: (uintmax_t)  uintmax  

Initializes an already allocated OFNumber with the specified uintmax_t.

Parameters:
uintmax An uintmax_t which the OFNumber should contain
Returns:
An initialized OFNumber
- (id) initWithULong: (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) initWithUShort: (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
- (id) multiplyWith: (OFNumber*)  num  

Multiplies the OFNumber with the specified OFNumber.

Parameters:
num The OFNumber to multiply with
+ (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) numberWithUChar: (unsigned char)  uchar  
Parameters:
uchar An unsigned char which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt16: (uint16_t)  uint16  
Parameters:
uint16 An uint16_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt32: (uint32_t)  uint32  
Parameters:
uint32 An uint32_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt64: (uint64_t)  uint64  
Parameters:
uint64 An uint64_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt8: (uint8_t)  uint8  
Parameters:
uint8 An uint8_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUInt: (unsigned int)  uint  
Parameters:
uint An unsigned int which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUIntMax: (uintmax_t)  uintmax  
Parameters:
uintmax An uintmax_t which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithULong: (unsigned long)  ulong  
Parameters:
ulong An unsigned long which the OFNumber should contain
Returns:
A new autoreleased OFNumber
+ (id) numberWithUShort: (unsigned short)  ushort  
Parameters:
ushort An unsigned short which the OFNumber should contain
Returns:
A new autoreleased OFNumber
- (id) subtract: (OFNumber*)  num  

Subtracts the specified OFNumber from the OFNumber.

Parameters:
num The OFNumber to substract
- (enum of_number_type) type  
Returns:
An enum of type of_number_type indicating the type of contained number of the OFNumber

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

Generated on Thu Dec 24 11:10:00 2009 for ObjFW by  doxygen 1.6.1