|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--moka.lang.Object | +--moka.lang.Double
The Double
class wraps a value of the primitive type
double
in an object. An object of type
Double
contains a single field whose type is
double
.
In addition, this class provides several methods for converting a
double
to a String
and a
String
to a double
, as well as other
constants and methods useful when dealing with a
double
.
This class can also be used to manipulate float.
Field Summary | |
static double |
MAX_VALUE
A constant holding the largest positive finite value of type double . |
static double |
MIN_VALUE
A constant holding the smallest positive nonzero value of type double . |
Constructor Summary | |
Double(double value)
Constructs a newly allocated Double object that
represents the primitive double argument. |
|
Double(moka.lang.String s)
Constructs a newly allocated Double object that
represents the value represented by the string. |
Method Summary | |
byte |
byteValue()
Returns the value of this Double as a byte . |
double |
doubleValue()
Returns the value of this Double as an
double . |
boolean |
equals(moka.lang.Object obj)
Compares this object to the specified object. |
int |
intValue()
Returns the value of this Double as an int . |
static boolean |
isDouble(moka.lang.String str)
Checks if the specified string is a decimal representation of a double. |
long |
longValue()
Returns the value of this Double as a long . |
static double |
parseDouble(moka.lang.String s)
Parses the string argument as a signed decimal integer. |
short |
shortValue()
Returns the value of this Double as a short . |
moka.lang.String |
toString()
Returns a String object representing this
Double 's value. |
Methods inherited from class moka.lang.Object |
finalize, getClassName |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final double MAX_VALUE
double
.
public static final double MIN_VALUE
double
.
Constructor Detail |
public Double(double value)
Double
object that
represents the primitive double
argument.
value
- the value to be represented by the Integer
.public Double(moka.lang.String s)
Double
object that
represents the value represented by the string. The string is
converted to an double in exactly the manner used by the
parseDouble method.
s
- the String
to be converted to an
Integer
.Method Detail |
public moka.lang.String toString()
String
object representing this
Double
's value. The value is converted to floating point,
format [-]d.dddde[sign]ddd (exponential format) representation and returned as a string, exactly as if
the double value were given as an argument to the valueOf method
of String.
toString
in class Object
public boolean equals(moka.lang.Object obj)
true
if and only if the argument is not
null
and is an Double
object that
contains the same double
value as this object.
equals
in class Object
obj
- the object to compare with.
true
if the objects are the same;
false
otherwise.public double doubleValue()
Double
as an
double
.
public static double parseDouble(moka.lang.String s)
s
- a String
containing the double
representation to be parsed
public int intValue()
int
.
This may involve rounding or truncation.
int
.public long longValue()
long
.
This may involve rounding or truncation.
long
.public byte byteValue()
byte
.
This may involve rounding or truncation.
byte
.public short shortValue()
short
.
This may involve rounding or truncation.
short
.public static boolean isDouble(moka.lang.String str)
str
- The string to verify
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |