|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
com.dautelle.math.numbers.RealtimeNumber
com.dautelle.physics.Quantity
com.dautelle.money.Money
This class represents something generally accepted as a medium of exchange,
a measure of value, or a means of payment. The system unit for this quantity
is a Currency
.
Currency
,
Serialized FormNested Class Summary |
Nested classes inherited from class com.dautelle.physics.Quantity |
Quantity.Factory, Quantity.Value |
Field Summary | |
static Money |
ZERO
Represents a Money amounting to nothing. |
Constructor Summary | |
protected |
Money()
Default constructor (allows for derivation). |
Method Summary | |
java.lang.StringBuffer |
appendTo(java.lang.StringBuffer sb,
Unit currency)
Appends the text representation of this quantity in fixed points notation to the StringBuffer argument. |
Currency |
getCurrency()
Returns the intrinsic Currency of this Money quantity
(the original currency from which the money has been created from). |
Unit |
getOutputUnit()
Returns the Currency unit that this Money quantity is
showed as. |
static Money |
moneyOf(Quantity quantity)
Returns the Money corresponding to the specified quantity. |
static void |
showAs(Currency currency)
Shows Money instances in the specified currency. |
Methods inherited from class com.dautelle.physics.Quantity |
abs, add, approxEquals, approxEquals, compareTo, divide, divide, doubleValue, doubleValue, equals, floatValue, floatValue, getAbsoluteError, getMaximum, getMinimum, getRelativeError, getSystemUnit, hashCode, intValue, intValue, inverse, isPossiblyZero, longValue, longValue, multiply, multiply, negate, opposite, plus, pow, random, reciprocal, root, subtract, times, toString, toString, toXml, valueOf, valueOf, valueOf, valueOf |
Methods inherited from class com.dautelle.math.numbers.RealtimeNumber |
clone, export, isLocalObject, isPoolObject, pow, recycle, toHeap |
Methods inherited from class java.lang.Number |
byteValue, shortValue |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Money ZERO
Money
amounting to nothing.
Constructor Detail |
protected Money()
Method Detail |
public static Money moneyOf(Quantity quantity)
Money
corresponding to the specified quantity.
quantity
- a quantity compatible with Money
.
Money
instance stated in
the reference currency.
ConversionException
- if the current model does not allow the
specified quantity to be converted to Money
.Currency.getReferenceCurrency()
public Currency getCurrency()
Currency
of this Money
quantity
(the original currency from which the money has been created from).
(Currency) getSystemUnit()
.public static void showAs(Currency currency)
Money
instances in the specified currency.
currency
- the output currency for Money
instances.Quantity.getOutputUnit()
public Unit getOutputUnit()
Currency
unit that this Money
quantity is
showed as. The default is this Money
's system unit (the currency
used to create this quantity). This default can be overriden using the
context-local showAs(com.dautelle.money.Currency)
static method.
getOutputUnit
in class Quantity
Quantity.toString()
,
Quantity.toXml(com.dautelle.xml.XmlElement)
public java.lang.StringBuffer appendTo(java.lang.StringBuffer sb, Unit currency)
StringBuffer
argument.
The number of digits after the decimal point is determinated
by the output currency.
appendTo
in class Quantity
sb
- the StringBuffer
to append.currency
- the currency unit this quantity is showed as.
StringBuffer
object.
ConversionException
- if the current model does not allow this
quantity to be stated as a currency.Currency.getDefaultFractionDigits(com.dautelle.money.Currency)
|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |