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,OvernightIndexandPriceIndexfor 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 CurrencygetCurrency()Gets the currency of the index.DayCountgetDayCount()Gets the day count convention of the index.default DayCountgetDefaultFixedLegDayCount()Gets the default day count convention for the associated fixed leg.FloatingRateNamegetFloatingRateName()Gets the floating rate name for this index.StringgetName()Gets the name that uniquely identifies this index.booleanisActive()Gets whether the index is active.static FloatingRateIndexof(String uniqueName)Obtains an instance from the specified unique name.static FloatingRateIndexparse(String indexStr)Parses a string, handling different types of index.static FloatingRateIndexparse(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:
IfFloatingRateNameis 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:
IfFloatingRateNameis 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:
IfFloatingRateNameis 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:
IfFloatingRateNameis 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,OvernightIndexandPriceIndex.- 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:
getCurrencyin 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
FloatingRateNamedoes not include the tenor. It can be used to find the other tenors available for this index.- Specified by:
getFloatingRateNamein 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
-
-