public final class CashFlow extends Object implements FxConvertible<CashFlow>, Comparable<CashFlow>, org.joda.beans.ImmutableBean, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
CashFlow.Meta
The meta-bean for
CashFlow. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(CashFlow other)
Compares this cash flow to another, first by date, then value.
|
CashFlow |
convertedTo(Currency resultCurrency,
FxRateProvider rateProvider)
Converts this cash flow to an equivalent amount in the specified currency.
|
boolean |
equals(Object obj) |
double |
getDiscountFactor()
Gets the discount factor.
|
CurrencyAmount |
getForecastValue()
Gets the forecast value of the cash flow.
|
LocalDate |
getPaymentDate()
Gets the payment date.
|
CurrencyAmount |
getPresentValue()
Gets the present value of the cash flow.
|
int |
hashCode() |
static CashFlow.Meta |
meta()
The meta-bean for
CashFlow. |
CashFlow.Meta |
metaBean() |
static CashFlow |
ofForecastValue(LocalDate paymentDate,
CurrencyAmount forecastValue,
double discountFactor)
Creates a
CashFlow representing a single cash flow from
payment date, forecast value and discount factor. |
static CashFlow |
ofForecastValue(LocalDate paymentDate,
Currency currency,
double forecastValue,
double discountFactor)
Creates a
CashFlow representing a single cash flow from payment date, forecast value amount,
discount factor and currency. |
static CashFlow |
ofPresentValue(LocalDate paymentDate,
CurrencyAmount presentValue,
double discountFactor)
Creates a
CashFlow representing a single cash flow from
payment date, present value and discount factor. |
static CashFlow |
ofPresentValue(LocalDate paymentDate,
Currency currency,
double presentValue,
double discountFactor)
Creates a
CashFlow representing a single cash flow from payment date, present value amount,
discount factor and currency. |
String |
toString() |
public static CashFlow ofPresentValue(LocalDate paymentDate, CurrencyAmount presentValue, double discountFactor)
CashFlow representing a single cash flow from
payment date, present value and discount factor.paymentDate - the payment datepresentValue - the present value as a currency amountdiscountFactor - the discount factorpublic static CashFlow ofPresentValue(LocalDate paymentDate, Currency currency, double presentValue, double discountFactor)
CashFlow representing a single cash flow from payment date, present value amount,
discount factor and currency.paymentDate - the payment datecurrency - the currencypresentValue - the amount of the present valuediscountFactor - the discount factorpublic static CashFlow ofForecastValue(LocalDate paymentDate, CurrencyAmount forecastValue, double discountFactor)
CashFlow representing a single cash flow from
payment date, forecast value and discount factor.paymentDate - the payment dateforecastValue - the forecast value as a currency amountdiscountFactor - the discount factorpublic static CashFlow ofForecastValue(LocalDate paymentDate, Currency currency, double forecastValue, double discountFactor)
CashFlow representing a single cash flow from payment date, forecast value amount,
discount factor and currency.paymentDate - the payment datecurrency - the currencyforecastValue - the amount of the forecast valuediscountFactor - the discount factorpublic CashFlow convertedTo(Currency resultCurrency, FxRateProvider rateProvider)
The result will have both the present and forecast value expressed in terms of the given currency. If conversion is needed, the provider will be used to supply the FX rate.
convertedTo in interface FxConvertible<CashFlow>resultCurrency - the currency of the resultrateProvider - the provider of FX ratesRuntimeException - if no FX rate could be foundpublic int compareTo(CashFlow other)
compareTo in interface Comparable<CashFlow>other - the other instancepublic static CashFlow.Meta meta()
CashFlow.public CashFlow.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic LocalDate getPaymentDate()
This is the date on which the cash flow occurs.
public CurrencyAmount getPresentValue()
The present value is signed. A negative value indicates a payment while a positive value indicates receipt.
public CurrencyAmount getForecastValue()
The forecast value is signed. A negative value indicates a payment while a positive value indicates receipt.
public double getDiscountFactor()
This is the discount factor between valuation date and the payment date. Thus present value is the forecast value multiplied by the discount factor.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.