Record Class OptionsBook.OptionPosition
java.lang.Object
java.lang.Record
com.quantfinlib.hedging.OptionsBook.OptionPosition
- Enclosing class:
OptionsBook
public static record OptionsBook.OptionPosition(String label, BlackScholes.OptionType type, double strike, double expiryYears, double quantity, double impliedVol)
extends Record
One option position;
quantity in option units (contract multiplier applied by caller).-
Constructor Summary
ConstructorsConstructorDescriptionOptionPosition(String label, BlackScholes.OptionType type, double strike, double expiryYears, double quantity, double impliedVol) Creates an instance of aOptionPositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of theexpiryYearsrecord component.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theimpliedVolrecord component.label()Returns the value of thelabelrecord component.doublequantity()Returns the value of thequantityrecord component.doublestrike()Returns the value of thestrikerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
OptionPosition
public OptionPosition(String label, BlackScholes.OptionType type, double strike, double expiryYears, double quantity, double impliedVol) Creates an instance of aOptionPositionrecord class.- Parameters:
label- the value for thelabelrecord componenttype- the value for thetyperecord componentstrike- the value for thestrikerecord componentexpiryYears- the value for theexpiryYearsrecord componentquantity- the value for thequantityrecord componentimpliedVol- the value for theimpliedVolrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
strike
public double strike()Returns the value of thestrikerecord component.- Returns:
- the value of the
strikerecord component
-
expiryYears
public double expiryYears()Returns the value of theexpiryYearsrecord component.- Returns:
- the value of the
expiryYearsrecord component
-
quantity
public double quantity()Returns the value of thequantityrecord component.- Returns:
- the value of the
quantityrecord component
-
impliedVol
public double impliedVol()Returns the value of theimpliedVolrecord component.- Returns:
- the value of the
impliedVolrecord component
-