public class Unit extends PrmNumber
| Modifier and Type | Field and Description |
|---|---|
static Unit |
MAX_UNIT
Maximum value
|
static Unit |
MIN_UNIT
Minimum value
|
static Unit |
ZERO_UNIT
Zero value
|
| Constructor and Description |
|---|
Unit(double d)
Constructs a
Unit object with a given unit value in double format. |
Unit(Number n)
Constructs a
Unit object with a given unit value in Number format. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PrmNumber obj)
Compares two
Unit objects. |
byteValue, compareTo, doubleValue, equals, floatValue, hashCode, intValue, longValue, setDoubleValue, shortValue, toStringpublic static final Unit MIN_UNIT
public static final Unit ZERO_UNIT
public static final Unit MAX_UNIT
public Unit(double d)
Unit object with a given unit value in double format.d - the unit valuepublic Unit(Number n)
Unit object with a given unit value in Number format.n - the unit valuepublic int compareTo(PrmNumber obj)
Unit objects.compareTo in interface Comparable<PrmNumber>compareTo in class PrmNumberobj - the Object to be compared.0 if the argument is a Unit numerically equal to
this Unit; a value less than 0 if the argument is a
Unit numerically greater than this Unit, or if the
argument is not a Unit; and a value greater than 0 if the
argument is a Unit numerically less than this Unit.Copyright © 2003, 2021, 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.