public class Tenor extends Object
A class representing tenors, such as SPOT, 1D (one day after SPOT), 1M (one month after SPOT) etc. Instances of Tenor
encapsulate an underlying String name, which can be retrieved by calling getName()
.
This class contains constants for all of the default tenors supported by the FX Integration API. Each of these default
tenors is represented by a name, and optionally one or more alternative names. For example, the _1Y
tenor is
represented by the name "1Y" and also the alternative name "12M". The getValue(String)
method will return one
of the default tenors if the provided string matches either the name or the alternative name, so calling getValue(String)
with either "1Y" or "12M" will return the _1Y
instance.
You can create your own instances of Tenor by passing any string into the getValue(String)
method. If the string
does not match the name or alternative name for any of the default tenors, a new instance of Tenor will be returned encapsulating
your string. This name can be retrieved by calling getName()
as normal.
Modifier and Type | Field and Description |
---|---|
static Tenor |
_10M
10 Months.
|
static Tenor |
_11M
11 Months.
|
static Tenor |
_15M
15 Months.
|
static Tenor |
_18M
18 Months.
|
static Tenor |
_1D
One Day after SPOT.
|
static Tenor |
_1M
1 Month.
|
static Tenor |
_1W
1 Week.
|
static Tenor |
_1Y
1 Year.
|
static Tenor |
_21M
21 Months.
|
static Tenor |
_2M
2 Months.
|
static Tenor |
_2W
2 Weeks.
|
static Tenor |
_2Y
2 Years.
|
static Tenor |
_3M
3 Months.
|
static Tenor |
_3W
3 Weeks.
|
static Tenor |
_3Y
3 Years.
|
static Tenor |
_4M
4 Months.
|
static Tenor |
_4W
4 Weeks
|
static Tenor |
_4Y
4 Years.
|
static Tenor |
_5M
5 Months.
|
static Tenor |
_5Y
5 Years.
|
static Tenor |
_6M
6 Months.
|
static Tenor |
_7M
7 months.
|
static Tenor |
_8M
8 Months.
|
static Tenor |
_9M
9 Months.
|
static Tenor |
_BROKEN
Broken Date.
|
static Tenor |
_ON
Overnight (SWAP Only).
|
static Tenor |
_SN
Spot Next.
|
static Tenor |
_SPOT
SPOT.
|
static Tenor |
_TN
Tomorrow Next (SWAP Only).
|
static Tenor |
_TODAY
Today.
|
static Tenor |
_TOM
Tomorrow.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Two instances of Tenor are considered equal if the underlying string
returned by the
getName() method are equal. |
String |
getName() |
static Tenor |
getValue(String tenorStr)
Parses the specified tenor string (in the format "1M" or "SPOT" etc) into
one of the static Tenor objects.
|
int |
hashCode()
The hash code for an instance of Tenor is equal to the hash code of the
underlying string returned by the
getName() method. |
String |
toString()
Returns the underling string.
|
static List<Tenor> |
values()
Returns a list containing all of the default Tenors defined as fields in this class.
|
public static final Tenor _ON
public static final Tenor _TODAY
public static final Tenor _TN
public static final Tenor _TOM
public static final Tenor _SPOT
public static final Tenor _1D
public static final Tenor _SN
public static final Tenor _1W
public static final Tenor _2W
public static final Tenor _3W
public static final Tenor _4W
public static final Tenor _1M
public static final Tenor _2M
public static final Tenor _3M
public static final Tenor _4M
public static final Tenor _5M
public static final Tenor _6M
public static final Tenor _7M
public static final Tenor _8M
public static final Tenor _9M
public static final Tenor _10M
public static final Tenor _11M
public static final Tenor _1Y
getValue(String)
with either "1Y" or "12M".public static final Tenor _15M
public static final Tenor _18M
public static final Tenor _21M
public static final Tenor _2Y
getValue(String)
with either "2Y" or "24M".public static final Tenor _3Y
getValue(String)
with either "3Y" or "36M".public static final Tenor _4Y
getValue(String)
with either "4Y" or "48M".public static final Tenor _5Y
getValue(String)
with either "5Y" or "60M".public static final Tenor _BROKEN
public String getName()
public static Tenor getValue(String tenorStr)
Parses the specified tenor string (in the format "1M" or "SPOT" etc) into one of the static Tenor objects.
One of the default tenor objects will be returned if the provided string
matches either the name or alternative name(s) for one of the default
tenors. For example, calling this method with either "1Y" or "12M" will
return _1Y
.
If a String cannot be matched to a tenor, a new instance of Tenor will be returned with that String as it's name.
tenorStr
- The string to parse.public static List<Tenor> values()
public boolean equals(Object obj)
getName()
method are equal.public int hashCode()
getName()
method.Copyright © 2015 Caplin Systems.