public class Cost extends PrmNumber
Modifier and Type | Field and Description |
---|---|
static Cost |
MAX_COST
Maximum value
|
static Cost |
MIN_COST
Minimum value
|
static Cost |
ZERO_COST
Zero value
|
Constructor and Description |
---|
Cost(double d)
Constructs a
Cost object with a given cost value in double format. |
Cost(Number n)
Constructs a
Cost object with a given cost value in Number format. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PrmNumber obj)
Compares two
Cost objects. |
double |
getValue()
Gets the cost value represented by this object.
|
byteValue, compareTo, doubleValue, equals, floatValue, hashCode, intValue, longValue, setDoubleValue, shortValue, toString
public static final Cost ZERO_COST
public static final Cost MAX_COST
public static final Cost MIN_COST
public Cost(double d)
Cost
object with a given cost value in double
format.d
- the cost valuepublic Cost(Number n)
Cost
object with a given cost value in Number
format.n
- the cost valuepublic int compareTo(PrmNumber obj)
Cost
objects.compareTo
in interface Comparable<PrmNumber>
compareTo
in class PrmNumber
obj
- the Object
to be compared.0
if the argument is a Cost
numerically equal to
this Cost
; a value less than 0
if the argument is a
Cost
numerically greater than this Cost
, or if the
argument is not a Cost
; and a value greater than 0
if the
argument is a Cost
numerically less than this Cost
.public double getValue()
Copyright © 2003, 2022, Oracle and/or its affiliates.
Oracle®, Java, and MySQL are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.