org.jquantlib.currencies
Class Money
- java.lang.Object
-
- org.jquantlib.currencies.Money
-
- All Implemented Interfaces:
- java.lang.Cloneable
public class Money extends java.lang.Object implements java.lang.CloneableCash amount in a given currency.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classMoney.ConversionType
-
Field Summary
Fields Modifier and Type Field and Description static CurrencybaseCurrencystatic Money.ConversionTypeconversionType
-
Constructor Summary
Constructors Constructor and Description Money()Money(Currency currency, double value)Money(double value, Currency currency)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description Moneyadd(Money money)MoneyaddAssign(Money money)+= OperatorMoneyclone()booleanclose_enough(Money money, int n)booleanclose(Money money, int n)voidconvertTo(Currency target)voidconvertToBase()Currencycurrency()Moneydiv(double x)doublediv(Money money)Returns the the value of this instance divided by another instance.MoneydivAssign(double x)booleanequals(Money money)Operator ==booleangreater(Money money)booleangreaterEqual(Money money)booleanless(Money money)booleanlessEquals(Money money)Moneymul(double x)MoneymulAssign(double x)static Moneymultiple(Currency c, double value)static Moneymultiple(double value, Currency c)MoneynegativeValue()booleannotEquals(Money money)MoneyoperatorMultiply(double value, Currency c)MoneypositiveValue()Moneyrounded()Moneysub(Money money)MoneysubAssign(Money money)-= Operatorjava.lang.StringtoString()doublevalue()
-
-
-
Field Detail
-
conversionType
public static Money.ConversionType conversionType
-
baseCurrency
public static Currency baseCurrency
-
-
Constructor Detail
-
Money
public Money()
-
Money
public Money(Currency currency, double value)
-
Money
public Money(double value, Currency currency)
-
-
Method Detail
-
clone
public Money clone()
- Overrides:
clonein classjava.lang.Object
-
currency
public Currency currency()
-
value
public double value()
-
rounded
public Money rounded()
-
positiveValue
public Money positiveValue()
-
negativeValue
public Money negativeValue()
-
mulAssign
public Money mulAssign(double x)
-
divAssign
public Money divAssign(double x)
-
mul
public Money mul(double x)
-
div
public Money div(double x)
-
notEquals
public boolean notEquals(Money money)
-
greater
public boolean greater(Money money)
-
greaterEqual
public boolean greaterEqual(Money money)
-
convertTo
public void convertTo(Currency target)
-
convertToBase
public void convertToBase()
-
addAssign
public Money addAssign(Money money)
+= Operator- Parameters:
money- The money to be added.- Returns:
- This money instance increased by the specified amount.
-
subAssign
public Money subAssign(Money money)
-= Operator- Parameters:
money- The money to be subtracted.- Returns:
- This money instance decreased by the specified amount.
-
div
public double div(Money money)
Returns the the value of this instance divided by another instance.- Parameters:
money- The amount this instance should be divided to.- Returns:
- The amount of this divided by money.
-
equals
public boolean equals(Money money)
Operator ==- Parameters:
money- The instance this instance should be compared to.- Returns:
- Whether this instance is equal to another instance
-
less
public boolean less(Money money)
-
lessEquals
public boolean lessEquals(Money money)
-
close
public boolean close(Money money, int n)
-
close_enough
public boolean close_enough(Money money, int n)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG