public final class Rate extends Object
| Constructor and Description |
|---|
Rate(double amount,
TimeUnit time)
This constructor builds an instance of this class from a currency
amount and a time unit.
|
Rate(Number amount,
TimeUnit time)
This constructor builds an instance of this class from a currency
amount and a time unit.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
amountComponentEquals(Rate rhs)
Equality test for amount component of a Rate instance.
|
boolean |
equals(Object obj) |
static boolean |
equals(Rate rate1,
Rate rate2)
Compare two rates handling null values.
|
double |
getAmount()
Accessor method to retrieve the currency amount.
|
TimeUnit |
getUnits()
Accessor method to retrieve the time units.
|
int |
hashCode() |
String |
toString() |
static Rate |
valueOf(Double value,
TimeUnit units)
Create a Rate instance from a value and units.
|
public static final Rate ZERO
public Rate(Number amount, TimeUnit time)
amount - currency amounttime - time unitspublic Rate(double amount,
TimeUnit time)
amount - currency amounttime - time unitspublic double getAmount()
public TimeUnit getUnits()
public static boolean equals(Rate rate1, Rate rate2)
rate1 - rate to comparerate2 - rate ro comparepublic boolean amountComponentEquals(Rate rhs)
rhs - rate to compareCopyright © 2000–2025 MPXJ. All rights reserved.