public enum NegativeRateMethod extends Enum<NegativeRateMethod> implements NamedEnum
When calculating a floating rate, the result may be negative. This convention defines whether to allow the negative value or round to zero.
| Enum Constant and Description |
|---|
ALLOW_NEGATIVE
The "Negative Interest Rate Method", that allows the rate to be negative.
|
NOT_NEGATIVE
The "Zero Rate Method", that prevents the rate from going below zero.
|
| Modifier and Type | Method and Description |
|---|---|
abstract double |
adjust(double rate)
Adjusts the specified rate according to the rate method rule.
|
static NegativeRateMethod |
of(String name)
Obtains an instance from the specified name.
|
String |
toString()
Returns the formatted name of the type.
|
static NegativeRateMethod |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NegativeRateMethod[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NegativeRateMethod ALLOW_NEGATIVE
When calculating a payment, negative rates are allowed and result in a payment in the opposite direction to that normally expected.
Defined by the 2006 ISDA definitions article 6.4b and 6.4c.
public static final NegativeRateMethod NOT_NEGATIVE
When calculating a payment, or other amount during compounding, the rate is not allowed to go below zero.
Defined by the 2006 ISDA definitions article 6.4d and 6.4e.
public static NegativeRateMethod[] values()
for (NegativeRateMethod c : NegativeRateMethod.values()) System.out.println(c);
public static NegativeRateMethod valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static NegativeRateMethod of(String name)
Parsing handles the mixed case form produced by toString() and
the upper and lower case variants of the enum constant name.
name - the name to parseIllegalArgumentException - if the name is not knownpublic abstract double adjust(double rate)
Given a rate, the result will be either the same rate, or zero, depending on the enum constant the method is called on.
rate - the rate to adjustpublic String toString()
toString in class Enum<NegativeRateMethod>Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.