Provides a way to store a number in an object. More...
#import <OFNumber.h>
Instance Methods | |
(id) | - initWithBool: |
Initializes an already allocated OFNumber with the specified BOOL. | |
(id) | - initWithChar: |
Initializes an already allocated OFNumber with the specified signed char. | |
(id) | - initWithShort: |
Initializes an already allocated OFNumber with the specified signed short. | |
(id) | - initWithInt: |
Initializes an already allocated OFNumber with the specified signed int. | |
(id) | - initWithLong: |
Initializes an already allocated OFNumber with the specified signed long. | |
(id) | - initWithUnsignedChar: |
Initializes an already allocated OFNumber with the specified unsigned char. | |
(id) | - initWithUnsignedShort: |
Initializes an already allocated OFNumber with the specified unsigned short. | |
(id) | - initWithUnsignedInt: |
Initializes an already allocated OFNumber with the specified unsigned int. | |
(id) | - initWithUnsignedLong: |
Initializes an already allocated OFNumber with the specified unsigned long. | |
(id) | - initWithInt8: |
Initializes an already allocated OFNumber with the specified int8_t. | |
(id) | - initWithInt16: |
Initializes an already allocated OFNumber with the specified int16_t. | |
(id) | - initWithInt32: |
Initializes an already allocated OFNumber with the specified int32_t. | |
(id) | - initWithInt64: |
Initializes an already allocated OFNumber with the specified int64_t. | |
(id) | - initWithUInt8: |
Initializes an already allocated OFNumber with the specified uint8_t. | |
(id) | - initWithUInt16: |
Initializes an already allocated OFNumber with the specified uint16_t. | |
(id) | - initWithUInt32: |
Initializes an already allocated OFNumber with the specified uint32_t. | |
(id) | - initWithUInt64: |
Initializes an already allocated OFNumber with the specified uint64_t. | |
(id) | - initWithSize: |
Initializes an already allocated OFNumber with the specified size_t. | |
(id) | - initWithSSize: |
Initializes an already allocated OFNumber with the specified ssize_t. | |
(id) | - initWithIntMax: |
Initializes an already allocated OFNumber with the specified intmax_t. | |
(id) | - initWithUIntMax: |
Initializes an already allocated OFNumber with the specified uintmax_t. | |
(id) | - initWithPtrDiff: |
Initializes an already allocated OFNumber with the specified ptrdiff_t. | |
(id) | - initWithIntPtr: |
Initializes an already allocated OFNumber with the specified intptr_t. | |
(id) | - initWithUIntPtr: |
Initializes an already allocated OFNumber with the specified uintptr_t. | |
(id) | - initWithFloat: |
Initializes an already allocated OFNumber with the specified float. | |
(id) | - initWithDouble: |
Initializes an already allocated OFNumber with the specified double. | |
(of_number_type_t) | - type |
Returns the type of the number. | |
(BOOL) | - boolValue |
Returns the OFNumber as a BOOL. | |
(signed char) | - charValue |
Returns the OFNumber as a signed char. | |
(signed short) | - shortValue |
Returns the OFNumber as a signed short. | |
(signed int) | - intValue |
Returns the OFNumber as a signed int. | |
(signed long) | - longValue |
Returns the OFNumber as a signed long. | |
(unsigned char) | - unsignedCharValue |
Returns the OFNumber as an unsigned char. | |
(unsigned short) | - unsignedShortValue |
Returns the OFNumber as an unsigned short. | |
(unsigned int) | - unsignedIntValue |
Returns the OFNumber as an unsigned int. | |
(unsigned long) | - unsignedLongValue |
Returns the OFNumber as an unsigned long. | |
(int8_t) | - int8Value |
Returns the OFNumber as an int8_t. | |
(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. | |
(uint8_t) | - uInt8Value |
Returns the OFNumber as a uint8_t. | |
(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. | |
(size_t) | - sizeValue |
Returns the OFNumber as a size_t. | |
(ssize_t) | - sSizeValue |
Returns the OFNumber as an ssize_t. | |
(intmax_t) | - intMaxValue |
Returns the OFNumber as an intmax_t. | |
(uintmax_t) | - uIntMaxValue |
Returns the OFNumber as a uintmax_t. | |
(ptrdiff_t) | - ptrDiffValue |
Returns the OFNumber as a ptrdiff_t. | |
(intptr_t) | - intPtrValue |
Returns the OFNumber as an intptr_t. | |
(uintptr_t) | - uIntPtrValue |
Returns the OFNumber as a uintptr_t. | |
(float) | - floatValue |
Returns the OFNumber as a float. | |
(double) | - doubleValue |
Returns the OFNumber as a double. | |
(OFNumber *) | - numberByAddingNumber: |
Creates a new OFNumber by adding the specified number. | |
(OFNumber *) | - numberBySubtractingNumber: |
Creates a new OFNumber by subtracting the specified number. | |
(OFNumber *) | - numberByMultiplyingWithNumber: |
Creates a new OFNumber by multiplying with the specified number. | |
(OFNumber *) | - numberByDividingWithNumber: |
Creates a new OFNumber by dividing with with the specified number. | |
(OFNumber *) | - numberByANDingWithNumber: |
Creates a new OFNumber by ANDing with the specified number. | |
(OFNumber *) | - numberByORingWithNumber: |
Creates a new OFNumber by ORing with the specified number. | |
(OFNumber *) | - numberByXORingWithNumber: |
Creates a new OFNumber by XORing with the specified number. | |
(OFNumber *) | - numberByShiftingLeftWithNumber: |
Creates a new OFNumber by shifting to the left by the specified number of bits. | |
(OFNumber *) | - numberByShiftingRightWithNumber: |
Creates a new OFNumber by shifting to the right by the specified number of bits. | |
(OFNumber *) | - numberByIncreasing |
Creates a new OFNumber by with the same value increased by one. | |
(OFNumber *) | - numberByDecreasing |
Creates a new OFNumber by with the same value decreased by one. | |
(OFNumber *) | - remainderOfDivisionWithNumber: |
Creates a new OFNumber with the remainder of a division with the specified number. | |
Instance Methods inherited from OFObject | |
(id) | - init |
Initializes an already allocated object. | |
(OFString *) | - className |
Returns the name of the object's class. | |
(OFString *) | - description |
Returns a description for the object. | |
(void *) | - allocMemoryWithSize: |
Allocates memory and stores it in the object's memory pool. | |
(void *) | - allocMemoryWithSize:count: |
Allocates memory for the specified number of items and stores it in the object's memory pool. | |
(void *) | - resizeMemory:size: |
Resizes memory in the object's memory pool to the specified size. | |
(void *) | - resizeMemory:size:count: |
Resizes memory in the object's memory pool to the specific number of items of the specified size. | |
(void) | - freeMemory: |
Frees allocated memory and removes it from the object's memory pool. | |
(void) | - dealloc |
Deallocates the object. | |
(void) | - performSelector:afterDelay: |
Performs the specified selector after the specified delay. | |
(void) | - performSelector:withObject:afterDelay: |
Performs the specified selector with the specified object after the specified delay. | |
(void) | - performSelector:withObject:withObject:afterDelay: |
Performs the specified selector with the specified objects after the specified delay. | |
(void) | - performSelector:onThread:waitUntilDone: |
Performs the specified selector on the specified thread. | |
(void) | - performSelector:onThread:withObject:waitUntilDone: |
Performs the specified selector on the specified thread with the specified object. | |
(void) | - performSelector:onThread:withObject:withObject:waitUntilDone: |
Performs the specified selector on the specified thread with the specified objects. | |
(void) | - performSelectorOnMainThread:waitUntilDone: |
Performs the specified selector on the main thread. | |
(void) | - performSelectorOnMainThread:withObject:waitUntilDone: |
Performs the specified selector on the main thread with the specified object. | |
(void) | - performSelectorOnMainThread:withObject:withObject:waitUntilDone: |
Performs the specified selector on the main thread with the specified objects. | |
(void) | - performSelector:onThread:afterDelay: |
Performs the specified selector on the specified thread after the specified delay. | |
(void) | - performSelector:onThread:withObject:afterDelay: |
Performs the specified selector on the specified thread with the specified object after the specified delay. | |
(void) | - performSelector:onThread:withObject:withObject:afterDelay: |
Performs the specified selector on the specified thread with the specified objects after the specified delay. | |
(OFString *) | - stringBySerializing |
Creates a string by serializing the receiver. | |
Instance Methods inherited from <OFObject> | |
(BOOL) | - isKindOfClass: |
Returns a boolean whether the object of the specified kind. | |
(BOOL) | - isMemberOfClass: |
Returns a boolean whether the object is a member of the specified class. | |
(BOOL) | - respondsToSelector: |
Returns a boolean whether the object responds to the specified selector. | |
(IMP) | - methodForSelector: |
Returns the implementation for the specified selector. | |
(const char *) | - typeEncodingForSelector: |
Returns the type encoding for the specified selector. | |
(id) | - performSelector: |
Performs the specified selector. | |
(id) | - performSelector:withObject: |
Performs the specified selector with the specified object. | |
(id) | - performSelector:withObject:withObject: |
Performs the specified selector with the specified objects. | |
(BOOL) | - isEqual: |
Checks two objects for equality. | |
(uint32_t) | - hash |
Calculates a hash for the object. | |
(id) | - retain |
Increases the retain count. | |
(unsigned int) | - retainCount |
Returns the retain count. | |
(void) | - release |
Decreases the retain count. | |
(id) | - autorelease |
Adds the object to the topmost OFAutoreleasePool of the thread's autorelease pool stack. | |
(id) | - self |
Returns the receiver. | |
(BOOL) | - isProxy |
Returns whether the object is a proxy object. | |
Instance Methods inherited from <OFCopying> | |
(id) | - copy |
Copies the object. | |
Instance Methods inherited from <OFComparing> | |
(of_comparison_result_t) | - compare: |
Compares the object with another object. | |
Instance Methods inherited from <OFSerialization> | |
(id) | - initWithSerialization: |
Initializes the object with the specified XML element serialization. | |
(OFXMLElement *) | - XMLElementBySerializing |
Serializes the object into an XML element. | |
Instance Methods inherited from <OFJSONRepresentation> | |
(OFString *) | - JSONRepresentation |
Returns the JSON representation of the object as a string. | |
Class Methods | |
(instancetype) | + numberWithBool: |
Creates a new OFNumber with the specified BOOL. | |
(instancetype) | + numberWithChar: |
Creates a new OFNumber with the specified signed char. | |
(instancetype) | + numberWithShort: |
Creates a new OFNumber with the specified signed short. | |
(instancetype) | + numberWithInt: |
Creates a new OFNumber with the specified signed int. | |
(instancetype) | + numberWithLong: |
Creates a new OFNumber with the specified signed long. | |
(instancetype) | + numberWithUnsignedChar: |
Creates a new OFNumber with the specified unsigned char. | |
(instancetype) | + numberWithUnsignedShort: |
Creates a new OFNumber with the specified unsigned short. | |
(instancetype) | + numberWithUnsignedInt: |
Creates a new OFNumber with the specified unsigned int. | |
(instancetype) | + numberWithUnsignedLong: |
Creates a new OFNumber with the specified unsigned long. | |
(instancetype) | + numberWithInt8: |
Creates a new OFNumber with the specified int8_t. | |
(instancetype) | + numberWithInt16: |
Creates a new OFNumber with the specified int16_t. | |
(instancetype) | + numberWithInt32: |
Creates a new OFNumber with the specified int32_t. | |
(instancetype) | + numberWithInt64: |
Creates a new OFNumber with the specified int64_t. | |
(instancetype) | + numberWithUInt8: |
Creates a new OFNumber with the specified uint8_t. | |
(instancetype) | + numberWithUInt16: |
Creates a new OFNumber with the specified uint16_t. | |
(instancetype) | + numberWithUInt32: |
Creates a new OFNumber with the specified uint32_t. | |
(instancetype) | + numberWithUInt64: |
Creates a new OFNumber with the specified uint64_t. | |
(instancetype) | + numberWithSize: |
Creates a new OFNumber with the specified size_t. | |
(instancetype) | + numberWithSSize: |
Creates a new OFNumber with the specified ssize_t. | |
(instancetype) | + numberWithIntMax: |
Creates a new OFNumber with the specified intmax_t. | |
(instancetype) | + numberWithUIntMax: |
Creates a new OFNumber with the specified uintmax_t. | |
(instancetype) | + numberWithPtrDiff: |
Creates a new OFNumber with the specified ptrdiff_t. | |
(instancetype) | + numberWithIntPtr: |
Creates a new OFNumber with the specified intptr_t. | |
(instancetype) | + numberWithUIntPtr: |
Creates a new OFNumber with the specified uintptr_t. | |
(instancetype) | + numberWithFloat: |
Creates a new OFNumber with the specified float. | |
(instancetype) | + numberWithDouble: |
Creates a new OFNumber with the specified double. | |
Class Methods inherited from OFObject | |
(void) | + load |
A method which is called once when the class is loaded into the runtime. | |
(void) | + initialize |
A method which is called the moment before the first call to the class is being made. | |
(id) | + alloc |
Allocates memory for an instance of the class and sets up the memory pool for the object. | |
(id) | + new |
Allocates memory for a new instance and calls -[init] on it. | |
(Class) | + class |
Returns the class. | |
(OFString *) | + className |
Returns the name of the class as a string. | |
(BOOL) | + isSubclassOfClass: |
Returns a boolean whether the class is a subclass of the specified class. | |
(Class) | + superclass |
Returns the superclass of the class. | |
(BOOL) | + instancesRespondToSelector: |
Checks whether instances of the class respond to a given selector. | |
(BOOL) | + conformsToProtocol: |
Checks whether the class conforms to a given protocol. | |
(IMP) | + instanceMethodForSelector: |
Returns the implementation of the instance method for the specified selector. | |
(const char *) | + typeEncodingForInstanceSelector: |
Returns the type encoding of the instance method for the specified selector. | |
(OFString *) | + description |
Returns a description for the class, which is usually the class name. | |
(IMP) | + replaceClassMethod:withMethodFromClass: |
Replaces a class method with a class method from another class. | |
(IMP) | + replaceInstanceMethod:withMethodFromClass: |
Replaces an instance method with an instance method from another class. | |
(IMP) | + replaceClassMethod:withImplementation:typeEncoding: |
Replaces or adds a class method. | |
(IMP) | + replaceInstanceMethod:withImplementation:typeEncoding: |
Replaces or adds an instance method. | |
(void) | + inheritMethodsFromClass: |
Adds all methods from the specified class to the class that is the receiver. | |
(BOOL) | + resolveClassMethod: |
Try to resolve the specified class method. | |
(BOOL) | + resolveInstanceMethod: |
Try to resolve the specified instance method. | |
Additional Inherited Members | |
Public Attributes inherited from OFObject | |
Class | isa |
The class of the object. | |
Provides a way to store a number in an object.
- (signed char) charValue |
- (id) initWithBool: | (BOOL) | bool_ |
- (id) initWithChar: | (signed char) | char_ |
- (id) initWithDouble: | (double) | double_ |
- (id) initWithFloat: | (float) | float_ |
- (id) initWithInt16: | (int16_t) | int16 |
- (id) initWithInt32: | (int32_t) | int32 |
- (id) initWithInt64: | (int64_t) | int64 |
- (id) initWithInt8: | (int8_t) | int8 |
- (id) initWithInt: | (signed int) | int_ |
- (id) initWithIntMax: | (intmax_t) | intmax |
- (id) initWithIntPtr: | (intptr_t) | intptr |
- (id) initWithLong: | (signed long) | long_ |
- (id) initWithPtrDiff: | (ptrdiff_t) | ptrdiff |
- (id) initWithShort: | (signed short) | short_ |
- (id) initWithSize: | (size_t) | size |
- (id) initWithSSize: | (ssize_t) | ssize |
- (id) initWithUInt16: | (uint16_t) | uint16 |
- (id) initWithUInt32: | (uint32_t) | uint32 |
- (id) initWithUInt64: | (uint64_t) | uint64 |
- (id) initWithUInt8: | (uint8_t) | uint8 |
- (id) initWithUIntMax: | (uintmax_t) | uintmax |
- (id) initWithUIntPtr: | (uintptr_t) | uintptr |
- (id) initWithUnsignedChar: | (unsigned char) | uchar |
- (id) initWithUnsignedInt: | (unsigned int) | uint |
- (id) initWithUnsignedLong: | (unsigned long) | ulong |
- (id) initWithUnsignedShort: | (unsigned short) | ushort |
- (OFNumber *) numberByDecreasing |
- (OFNumber *) numberByIncreasing |
+ (instancetype) numberWithBool: | (BOOL) | bool_ |
+ (instancetype) numberWithChar: | (signed char) | char_ |
+ (instancetype) numberWithDouble: | (double) | double_ |
+ (instancetype) numberWithFloat: | (float) | float_ |
+ (instancetype) numberWithInt16: | (int16_t) | int16 |
+ (instancetype) numberWithInt32: | (int32_t) | int32 |
+ (instancetype) numberWithInt64: | (int64_t) | int64 |
+ (instancetype) numberWithInt8: | (int8_t) | int8 |
+ (instancetype) numberWithInt: | (signed int) | int_ |
+ (instancetype) numberWithIntMax: | (intmax_t) | intmax |
+ (instancetype) numberWithIntPtr: | (intptr_t) | intptr |
+ (instancetype) numberWithLong: | (signed long) | long_ |
+ (instancetype) numberWithPtrDiff: | (ptrdiff_t) | ptrdiff |
+ (instancetype) numberWithShort: | (signed short) | short_ |
+ (instancetype) numberWithSize: | (size_t) | size |
+ (instancetype) numberWithSSize: | (ssize_t) | ssize |
+ (instancetype) numberWithUInt16: | (uint16_t) | uint16 |
+ (instancetype) numberWithUInt32: | (uint32_t) | uint32 |
+ (instancetype) numberWithUInt64: | (uint64_t) | uint64 |
+ (instancetype) numberWithUInt8: | (uint8_t) | uint8 |
+ (instancetype) numberWithUIntMax: | (uintmax_t) | uintmax |
+ (instancetype) numberWithUIntPtr: | (uintptr_t) | uintptr |
+ (instancetype) numberWithUnsignedChar: | (unsigned char) | uchar |
+ (instancetype) numberWithUnsignedInt: | (unsigned int) | uint |
+ (instancetype) numberWithUnsignedLong: | (unsigned long) | ulong |
+ (instancetype) numberWithUnsignedShort: | (unsigned short) | ushort |
Creates a new OFNumber with the remainder of a division with the specified number.
num | The number to divide by |
- (of_number_type_t) type |
Returns the type of the number.
- (unsigned char) unsignedCharValue |
- (unsigned int) unsignedIntValue |
- (unsigned long) unsignedLongValue |
- (unsigned short) unsignedShortValue |