public class PrmNumber extends Number implements Comparable<PrmNumber>
Number
.Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Returns the value of the specified number as a
byte . |
int |
compareTo(double value)
Compare this
PrmNumber object to a double . |
int |
compareTo(PrmNumber obj)
Compare two
PrmNumber objects. |
double |
doubleValue()
Returns the value of the specified number as a
double . |
boolean |
equals(Object obj)
Compares this
PrmNumber to the specified object. |
float |
floatValue()
Returns the value of the specified number as a
float . |
int |
hashCode()
Returns a hash code for this object.
|
int |
intValue()
Returns the value of the specified number as an
int . |
long |
longValue()
Returns the value of the specified number as a
long . |
void |
setDoubleValue(double v)
Set the value of this object with a given value.
|
short |
shortValue()
Returns the value of the specified number as a
short . |
String |
toString()
Returns a string representation of the object.
|
public static final PrmNumber ZERO
public String toString()
public double doubleValue()
double
. This may involve
rounding.doubleValue
in class Number
double
.public int hashCode()
public float floatValue()
float
. This may involve
rounding.floatValue
in class Number
float
.public long longValue()
long
. This may involve rounding
or truncation.public int intValue()
int
. This may involve rounding
or truncation.public short shortValue()
short
. This may involve rounding
or truncation.shortValue
in class Number
short
.public byte byteValue()
byte
. This may involve rounding
or truncation.public int compareTo(PrmNumber obj)
PrmNumber
objects.compareTo
in interface Comparable<PrmNumber>
obj
- the Object
to be compared.0
if the argument is a PrmNumber
numerically
equal to this PrmNumber
; a value less than 0
if the
argument is a PrmNumber
numerically greater than this
PrmNumber
, or if the argument is not a PrmNumber
; and a
value greater than 0
if the argument is a PrmNumber
numerically less than this PrmNumber
.public int compareTo(double value)
PrmNumber
object to a double
.value
- the double
to be compared.0
if the argument is numerically equal to the value presented
by this PrmNumber
; a value less than 0
if the argument is
numerically greater than the value presented by this PrmNumber
; and a
value greater than 0
if the argument is numerically less than the
value presented by this PrmNumber
.public boolean equals(Object obj)
PrmNumber
to the specified object. The result is true if
compareTo(obj) is 0public void setDoubleValue(double v)
v
- the value.Copyright © 2003, 2020, Oracle and/or its affiliates.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.