public final class CashFlows extends Object implements FxConvertible<CashFlows>, org.joda.beans.ImmutableBean, Serializable
Contains a list of cash flow objects, each referring to a single cash flow. The list is can be sorted by date and value if desired.
| Modifier and Type | Class and Description |
|---|---|
static class |
CashFlows.Meta
The meta-bean for
CashFlows. |
| Modifier and Type | Field and Description |
|---|---|
static CashFlows |
NONE
A cash flows instance to be used when there is no cash flow.
|
| Modifier and Type | Method and Description |
|---|---|
CashFlows |
combinedWith(CashFlow cashFlow)
Combines this cash flows instance with another cash flow.
|
CashFlows |
combinedWith(CashFlows other)
Combines this cash flows instance with another one.
|
CashFlows |
convertedTo(Currency resultCurrency,
FxRateProvider rateProvider)
Converts this collection of cash flows to an equivalent amount in the specified currency.
|
boolean |
equals(Object obj) |
CashFlow |
getCashFlow(int index)
Gets the cash flow by index.
|
ImmutableList<CashFlow> |
getCashFlows()
Gets the cash flows.
|
int |
hashCode() |
static CashFlows.Meta |
meta()
The meta-bean for
CashFlows. |
CashFlows.Meta |
metaBean() |
static CashFlows |
of(CashFlow cashFlow)
Obtains an instance from a single cash flow.
|
static CashFlows |
of(List<CashFlow> cashFlows)
Obtains an instance from a list of cash flows.
|
CashFlows |
sorted()
Returns an instance that is sorted.
|
String |
toString() |
public static final CashFlows NONE
public static CashFlows of(CashFlow cashFlow)
cashFlow - The cash flowpublic static CashFlows of(List<CashFlow> cashFlows)
cashFlows - the list of cash flowspublic CashFlow getCashFlow(int index)
index - the index to getpublic CashFlows combinedWith(CashFlow cashFlow)
This returns a new cash flows instance with a combined list of cash flow instances. This instance is immutable and unaffected by this method. The result may contain duplicate cash flows.
cashFlow - the additional single cash flowCashFlows based on this instance, with the additional single cash flow addedpublic CashFlows combinedWith(CashFlows other)
This returns a new cash flows instance with a combined list of cash flow instances. This instance is immutable and unaffected by this method. The result may contain duplicate cash flows.
other - the other cash flowsCashFlows based on this instance, with the other instance addedpublic CashFlows sorted()
The sort is by date, then value.
public CashFlows convertedTo(Currency resultCurrency, FxRateProvider rateProvider)
This ensures that the result will have all currency amounts 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<CashFlows>resultCurrency - the currency of the resultrateProvider - the provider of FX ratesRuntimeException - if no FX rate could be foundpublic static CashFlows.Meta meta()
CashFlows.public CashFlows.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic ImmutableList<CashFlow> getCashFlows()
Each entry includes details of a single cash flow.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.