public class Percent extends PrmNumber
Modifier and Type | Field and Description |
---|---|
static Percent |
HUNDRED_PERCENT
100.0%
|
static Percent |
MAX_PERCENT
Maximum value
|
static Percent |
MIN_PERCENT
Minimum Value
|
static Percent |
ZERO_PERCENT
0.0%
|
Constructor and Description |
---|
Percent(double d)
Constructs a
Percent object with a given percent value in double
format. |
Percent(Number n)
Constructs a
Percent object with a given percent value in Number
format. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PrmNumber obj)
Compares two
Percent objects. |
byteValue, compareTo, doubleValue, equals, floatValue, hashCode, intValue, longValue, setDoubleValue, shortValue, toString
public static final Percent ZERO_PERCENT
public static final Percent MAX_PERCENT
public static final Percent HUNDRED_PERCENT
public static final Percent MIN_PERCENT
public Percent(double d)
Percent
object with a given percent value in double
format. Note that one-hundred percent (100%) is represented by 1.0, 25% is represented by
0.25, etc.d
- the percent valuepublic Percent(Number n)
Percent
object with a given percent value in Number
format. Note that one-hundred percent (100%) is represented by 1.0, 25% is represented by
0.25, etc.n
- the percent valuepublic int compareTo(PrmNumber obj)
Percent
objects.compareTo
in interface Comparable<PrmNumber>
compareTo
in class PrmNumber
obj
- the Object
to be compared.0
if the argument is a Percent
numerically equal
to this Percent
; a value less than 0
if the argument is a
Percent
numerically greater than this Percent
, or if the
argument is not a Percent
; and a value greater than 0
if
the argument is a Percent
numerically less than this
Percent
.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.