Interface FloatingRateIndex
-
- All Superinterfaces:
FloatingRate
,Index
,Named
- All Known Subinterfaces:
IborIndex
,OvernightIndex
,PriceIndex
,RateIndex
- All Known Implementing Classes:
ImmutableIborIndex
,ImmutableOvernightIndex
,ImmutablePriceIndex
public interface FloatingRateIndex extends Index, FloatingRate
An index used to provide floating rates, typically in interest rate swaps.See
IborIndex
,OvernightIndex
andPriceIndex
for more details.All implementations of this interface must be immutable and thread-safe.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Currency
getCurrency()
Gets the currency of the index.DayCount
getDayCount()
Gets the day count convention of the index.default DayCount
getDefaultFixedLegDayCount()
Gets the default day count convention for the associated fixed leg.FloatingRateName
getFloatingRateName()
Gets the floating rate name for this index.String
getName()
Gets the name that uniquely identifies this index.boolean
isActive()
Gets whether the index is active.static FloatingRateIndex
of(String uniqueName)
Obtains an instance from the specified unique name.static FloatingRateIndex
parse(String indexStr)
Parses a string, handling different types of index.static FloatingRateIndex
parse(String indexStr, Tenor defaultIborTenor)
Parses a string, handling different types of index, optionally specifying a tenor for Ibor.static Optional<FloatingRateIndex>
tryParse(String indexStr)
Parses a string, handling different types of index.static Optional<FloatingRateIndex>
tryParse(String indexStr, Tenor defaultIborTenor)
Parses a string, handling different types of index, optionally specifying a tenor for Ibor.
-
-
-
Method Detail
-
parse
static FloatingRateIndex parse(String indexStr)
Parses a string, handling different types of index.This tries a number of ways to parse the input:
IfFloatingRateName
is used to match an Ibor index, then a tenor is needed to return an index. The tenor fromFloatingRateName.getDefaultTenor()
will be used.- Parameters:
indexStr
- the index string to parse- Returns:
- the floating rate
- Throws:
IllegalArgumentException
- if the name is not known
-
parse
static FloatingRateIndex parse(String indexStr, Tenor defaultIborTenor)
Parses a string, handling different types of index, optionally specifying a tenor for Ibor.This tries a number of ways to parse the input:
IfFloatingRateName
is used to match an Ibor index, then a tenor is needed to return an index. The tenor can optionally be supplied. If needed and missing, the result ofFloatingRateName.getDefaultTenor()
will be used.- Parameters:
indexStr
- the index string to parsedefaultIborTenor
- the tenor to use for Ibor if matched as aFloatingRateName
, may be null- Returns:
- the floating rate
- Throws:
IllegalArgumentException
- if the name is not known
-
tryParse
static Optional<FloatingRateIndex> tryParse(String indexStr)
Parses a string, handling different types of index.This tries a number of ways to parse the input:
IfFloatingRateName
is used to match an Ibor index, then a tenor is needed to return an index. The tenor fromFloatingRateName.getDefaultTenor()
will be used.- Parameters:
indexStr
- the index string to parse- Returns:
- the floating rate index, empty if not found
-
tryParse
static Optional<FloatingRateIndex> tryParse(String indexStr, Tenor defaultIborTenor)
Parses a string, handling different types of index, optionally specifying a tenor for Ibor.This tries a number of ways to parse the input:
IfFloatingRateName
is used to match an Ibor index, then a tenor is needed to return an index. The tenor can optionally be supplied. If needed and missing, the result ofFloatingRateName.getDefaultTenor()
will be used.- Parameters:
indexStr
- the index string to parsedefaultIborTenor
- the tenor to use for Ibor if matched as aFloatingRateName
, may be null- Returns:
- the floating rate index, empty if not found
-
of
static FloatingRateIndex of(String uniqueName)
Obtains an instance from the specified unique name.This parses names from
IborIndex
,OvernightIndex
andPriceIndex
.- Parameters:
uniqueName
- the unique name- Returns:
- the index
- Throws:
IllegalArgumentException
- if the name is not known
-
getName
String getName()
Gets the name that uniquely identifies this index.This name is used in serialization and can be parsed using
of(String)
.
-
getCurrency
Currency getCurrency()
Gets the currency of the index.- Specified by:
getCurrency
in interfaceFloatingRate
- Returns:
- the currency of the index
-
isActive
boolean isActive()
Gets whether the index is active.Over time some indices become inactive and are no longer produced. If this occurs, this method will return false.
- Returns:
- true if the index is active, false if inactive
-
getDayCount
DayCount getDayCount()
Gets the day count convention of the index.- Returns:
- the day count convention
-
getFloatingRateName
FloatingRateName getFloatingRateName()
Gets the floating rate name for this index.For an Ibor index, the
FloatingRateName
does not include the tenor. It can be used to find the other tenors available for this index.- Specified by:
getFloatingRateName
in interfaceFloatingRate
- Returns:
- the floating rate name
-
getDefaultFixedLegDayCount
default DayCount getDefaultFixedLegDayCount()
Gets the default day count convention for the associated fixed leg.A rate index is often paid against a fixed leg, such as in a vanilla Swap. The day count convention of the fixed leg often differs from that of the index, and the default is value is available here.
- Returns:
- the day count convention
-
-