Class CPNumber

CPObject
    extended byCPNumber

@implementation CPNumber : CPObject

This class primarily exists for source compatability. The JavaScript Number type can be changed on the fly based on context, so there is no need to call any of these methods.


Method Summary
+(id)alloc
          Allocates a new instance of the receiving class.
+(id)numberWithBool:(BOOL)aBoolean
+(id)numberWithChar:(char)aChar
+(id)numberWithDouble:(double)aDouble
+(id)numberWithFloat:(float)aFloat
+(id)numberWithInt:(int)anInt
+(id)numberWithLong:(long)aLong
+(id)numberWithLongLong:(long long)aLongLong
+(id)numberWithShort:(short)aShort
+(id)numberWithUnsignedChar:(unsigned char)aChar
+(id)numberWithUnsignedInt:(unsigned)anUnsignedInt
+(id)numberWithUnsignedLong:(unsigned long)anUnsignedLong
+(id)numberWithUnsignedShort:(unsigned short)anUnsignedShort
          + (id)numberWithUnsignedLongLong:(unsigned long long)anUnsignedLongLong { return anUnsignedLongLong; }.
-(id)initWithBool:(BOOL)aBoolean
-(id)initWithChar:(char)aChar
-(id)initWithCoder:(CPCoder)aCoder
-(id)initWithDouble:(double)aDouble
-(id)initWithFloat:(float)aFloat
-(id)initWithInt:(int)anInt
-(id)initWithLong:(long)aLong
-(id)initWithLongLong:(long long)aLongLong
-(id)initWithShort:(short)aShort
-(id)initWithUnsignedChar:(unsigned char)aChar
-(id)initWithUnsignedInt:(unsigned)anUnsignedInt
-(id)initWithUnsignedLong:(unsigned long)anUnsignedLong
-(id)initWithUnsignedShort:(unsigned short)anUnsignedShort
          - (id)initWithUnsignedLongLong:(unsigned long long)anUnsignedLongLong { return anUnsignedLongLong; }.
-(BOOL)boolValue
-(char)charValue
-(CPComparisonResult)compare:(CPNumber)aNumber
-(CPDecimal)decimalValue
          FIXME: Do we need this?.
-(CPString)description
          Returns a human readable string describing the receiver.
-(CPString)descriptionWithLocale:(CPDictionary)aDictionary
-(double)doubleValue
-(void)encodeWithCoder:(CPCoder)aCoder
-(float)floatValue
-(CPString)hash
          Returns a hash for the object.
-(int)intValue
-(BOOL)isEqualToNumber:(CPNumber)aNumber
-(long long)longLongValue
-(long)longValue
-(short)shortValue
-(CPString)stringValue
-(unsigned char)unsignedCharValue
-(unsigned int)unsignedIntValue
-(unsigned long)unsignedLongValue
          - (unsigned long long)unsignedLongLongValue { if (typeof self == "boolean") return self ? 1 : 0; return self; }.
-(unsigned short)unsignedShortValue

Methods inherited from class CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass


Method Detail

alloc

+(id)alloc
Allocates a new instance of the receiving class

numberWithBool

+(id)numberWithBool:(BOOL)aBoolean
Parameters:
aBoolean

numberWithChar

+(id)numberWithChar:(char)aChar
Parameters:
aChar

numberWithDouble

+(id)numberWithDouble:(double)aDouble
Parameters:
aDouble

numberWithFloat

+(id)numberWithFloat:(float)aFloat
Parameters:
aFloat

numberWithInt

+(id)numberWithInt:(int)anInt
Parameters:
anInt

numberWithLong

+(id)numberWithLong:(long)aLong
Parameters:
aLong

numberWithLongLong

+(id)numberWithLongLong:(long long)aLongLong
Parameters:
aLongLong

numberWithShort

+(id)numberWithShort:(short)aShort
Parameters:
aShort

numberWithUnsignedChar

+(id)numberWithUnsignedChar:(unsigned char)aChar
Parameters:
aChar

numberWithUnsignedInt

+(id)numberWithUnsignedInt:(unsigned)anUnsignedInt
Parameters:
anUnsignedInt

numberWithUnsignedLong

+(id)numberWithUnsignedLong:(unsigned long)anUnsignedLong
Parameters:
anUnsignedLong

numberWithUnsignedShort

+(id)numberWithUnsignedShort:(unsigned short)anUnsignedShort
+ (id)numberWithUnsignedLongLong:(unsigned long long)anUnsignedLongLong { return anUnsignedLongLong; }
Parameters:
anUnsignedShort

initWithBool

-(id)initWithBool:(BOOL)aBoolean
Parameters:
aBoolean

initWithChar

-(id)initWithChar:(char)aChar
Parameters:
aChar

initWithCoder

-(id)initWithCoder:(CPCoder)aCoder
Parameters:
aCoder

initWithDouble

-(id)initWithDouble:(double)aDouble
Parameters:
aDouble

initWithFloat

-(id)initWithFloat:(float)aFloat
Parameters:
aFloat

initWithInt

-(id)initWithInt:(int)anInt
Parameters:
anInt

initWithLong

-(id)initWithLong:(long)aLong
Parameters:
aLong

initWithLongLong

-(id)initWithLongLong:(long long)aLongLong
Parameters:
aLongLong

initWithShort

-(id)initWithShort:(short)aShort
Parameters:
aShort

initWithUnsignedChar

-(id)initWithUnsignedChar:(unsigned char)aChar
Parameters:
aChar

initWithUnsignedInt

-(id)initWithUnsignedInt:(unsigned)anUnsignedInt
Parameters:
anUnsignedInt

initWithUnsignedLong

-(id)initWithUnsignedLong:(unsigned long)anUnsignedLong
Parameters:
anUnsignedLong

initWithUnsignedShort

-(id)initWithUnsignedShort:(unsigned short)anUnsignedShort
- (id)initWithUnsignedLongLong:(unsigned long long)anUnsignedLongLong { return anUnsignedLongLong; }
Parameters:
anUnsignedShort

boolValue

-(BOOL)boolValue

charValue

-(char)charValue

compare

-(CPComparisonResult)compare:(CPNumber)aNumber
Parameters:
aNumber

decimalValue

-(CPDecimal)decimalValue
FIXME: Do we need this?

description

-(CPString)description
Returns a human readable string describing the receiver

descriptionWithLocale

-(CPString)descriptionWithLocale:(CPDictionary)aDictionary
Parameters:
aDictionary

doubleValue

-(double)doubleValue

encodeWithCoder

-(void)encodeWithCoder:(CPCoder)aCoder
Parameters:
aCoder

floatValue

-(float)floatValue

hash

-(CPString)hash
Returns a hash for the object

intValue

-(int)intValue

isEqualToNumber

-(BOOL)isEqualToNumber:(CPNumber)aNumber
Parameters:
aNumber

longLongValue

-(long long)longLongValue

longValue

-(long)longValue

shortValue

-(short)shortValue

stringValue

-(CPString)stringValue

unsignedCharValue

-(unsigned char)unsignedCharValue

unsignedIntValue

-(unsigned int)unsignedIntValue

unsignedLongValue

-(unsigned long)unsignedLongValue
- (unsigned long long)unsignedLongLongValue { if (typeof self == "boolean") return self ? 1 : 0; return self; }

unsignedShortValue

-(unsigned short)unsignedShortValue

Created on Sat Sep 13 14:15:43 PDT 2008