public interface Currency extends OsidPrimitive, java.lang.Comparable<Currency>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Currency currency)
Compares this currency with the specified Currency for
order.
|
boolean |
equals(java.lang.Object obj)
Determines if the given
Currency is equal to
this one. |
int |
hashCode()
Returns a hash code value for this
Currency . |
boolean |
isLarger(Currency currency)
Tests if this Currency is greater than the given Currency.
|
boolean |
isSmaller(Currency currency)
Tests if this Currency is less than the given Currency.
|
toString
boolean isLarger(Currency currency)
currency
- the currency to comparetrue
if this currency is larger,
false
otherwiseNullArgumentException
- currency
is null
UnsupportedException
- cannot compare currency typesboolean isSmaller(Currency currency)
currency
- the currency to comparetrue
if this currency is less,
false
otherwiseNullArgumentException
- currency
is null
UnsupportedException
- cannot compare currency typesint compareTo(Currency currency)
isLarger()
or
isSmaller()
instead.compareTo
in interface java.lang.Comparable<Currency>
currency
- the currency to be comparedjava.lang.ClassCastException
- if the specified cuurency's type
prevents it from being compared to this currencyboolean equals(java.lang.Object obj)
Currency
is equal to
this one.
Two Currency objects are equal if their Currency Types and
Currency amounts, and the precision in the currency amounts
are equal.equals
in class java.lang.Object
obj
- an object to compare true
if the given object is equal to
this Currency
, false
otherwiseint hashCode()
Currency
. The
hash code is determined from the currency type and currency
amount.hashCode
in class java.lang.Object