CPObjectCPNumber
@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 |
Method Detail |
---|
+(id)alloc
+(id)numberWithBool:(BOOL)aBoolean
aBoolean
+(id)numberWithChar:(char)aChar
aChar
+(id)numberWithDouble:(double)aDouble
aDouble
+(id)numberWithFloat:(float)aFloat
aFloat
+(id)numberWithInt:(int)anInt
anInt
+(id)numberWithLong:(long)aLong
aLong
+(id)numberWithLongLong:(long long)aLongLong
aLongLong
+(id)numberWithShort:(short)aShort
aShort
+(id)numberWithUnsignedChar:(unsigned char)aChar
aChar
+(id)numberWithUnsignedInt:(unsigned)anUnsignedInt
anUnsignedInt
+(id)numberWithUnsignedLong:(unsigned long)anUnsignedLong
anUnsignedLong
+(id)numberWithUnsignedShort:(unsigned short)anUnsignedShort
anUnsignedShort
-(id)initWithBool:(BOOL)aBoolean
aBoolean
-(id)initWithChar:(char)aChar
aChar
-(id)initWithCoder:(CPCoder)aCoder
aCoder
-(id)initWithDouble:(double)aDouble
aDouble
-(id)initWithFloat:(float)aFloat
aFloat
-(id)initWithInt:(int)anInt
anInt
-(id)initWithLong:(long)aLong
aLong
-(id)initWithLongLong:(long long)aLongLong
aLongLong
-(id)initWithShort:(short)aShort
aShort
-(id)initWithUnsignedChar:(unsigned char)aChar
aChar
-(id)initWithUnsignedInt:(unsigned)anUnsignedInt
anUnsignedInt
-(id)initWithUnsignedLong:(unsigned long)anUnsignedLong
anUnsignedLong
-(id)initWithUnsignedShort:(unsigned short)anUnsignedShort
anUnsignedShort
-(BOOL)boolValue
-(char)charValue
-(CPComparisonResult)compare:(CPNumber)aNumber
aNumber
-(CPDecimal)decimalValue
-(CPString)description
-(CPString)descriptionWithLocale:(CPDictionary)aDictionary
aDictionary
-(double)doubleValue
-(void)encodeWithCoder:(CPCoder)aCoder
aCoder
-(float)floatValue
-(CPString)hash
-(int)intValue
-(BOOL)isEqualToNumber:(CPNumber)aNumber
aNumber
-(long long)longLongValue
-(long)longValue
-(short)shortValue
-(CPString)stringValue
-(unsigned char)unsignedCharValue
-(unsigned int)unsignedIntValue
-(unsigned long)unsignedLongValue
-(unsigned short)unsignedShortValue
Created on Sat Sep 13 14:15:43 PDT 2008