|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.web3d.vrtp.datatypes.PrimitiveNumber
PrimitiveNumber
Grumble. Java's object counterparts to the primitive types (Integer, Char, Float, etc) are lousy in that you can't really change values once you create them. This is a parallel object hierarchy that does a few more things, and conforms to the Primitive interface, which specifies the minimum operations required for compliance with dabp. This hierarchy is also mutable, while Java's default hierarchy is immutable. Primitive types that are numeric, such as UnsignedByte, SignedInteger, etc, should inherit from this. Other primitive types, such as strings, should inherit from something else.
This would be a great place to do categories if this were objective-c. Dangit.
Constructor Summary | |
PrimitiveNumber()
|
Method Summary | |
abstract void |
add(int pValue)
Add the given value to the existing value |
byte |
byteValue()
Returns the value of the specified number as a byte . |
abstract java.lang.Object |
clone()
Implementation of the Cloneable interface. |
abstract void |
decrement()
Subtract one from the value |
abstract double |
doubleValue()
Returns the value of the specified number as a double . |
abstract boolean |
equals(java.lang.Object anObject)
implementation of Comparable interface |
abstract float |
floatValue()
Returns the value of the specified number as a float . |
abstract void |
increment()
Add one to the value |
abstract int |
intValue()
Returns the value of the specified number as an int . |
abstract long |
longValue()
Returns the value of the specified number as a long . |
short |
shortValue()
Returns the value of the specified number as a short . |
abstract void |
subtract(int pValue)
Subtract the given value from the existing value |
Methods inherited from class java.lang.Object |
|
Methods inherited from interface org.web3d.vrtp.datatypes.Primitive |
compareTo, getSize, hashCode, initializeWithBinary, initializeWithString, serialize, toString |
Methods inherited from interface java.lang.Comparable |
compareTo |
Constructor Detail |
public PrimitiveNumber()
Method Detail |
public abstract boolean equals(java.lang.Object anObject)
equals
in interface Primitive
equals
in class java.lang.Object
public abstract java.lang.Object clone()
clone
in interface Primitive
clone
in class java.lang.Object
public abstract int intValue()
int
.
This may involve rounding.int
.public abstract long longValue()
long
.
This may involve rounding.long
.public abstract float floatValue()
float
.
This may involve rounding.float
.public abstract double doubleValue()
double
.
This may involve rounding.double
.public byte byteValue()
byte
.
This may involve rounding or truncation.byte
.public short shortValue()
short
.
This may involve rounding or truncation.short
.public abstract void increment()
ArithmeticIF
increment
in interface ArithmeticIF
public abstract void decrement()
ArithmeticIF
decrement
in interface ArithmeticIF
public abstract void add(int pValue)
ArithmeticIF
add
in interface ArithmeticIF
public abstract void subtract(int pValue)
ArithmeticIF
subtract
in interface ArithmeticIF
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |