Package com.walkfares.calendar
Class CurveDate
java.lang.Object
com.walkfares.calendar.UTCDate
com.walkfares.calendar.CurveDate
- All Implemented Interfaces:
Comparable<UTCDate>
public class CurveDate extends UTCDate
CurveDate is an extension of UTCDate with an attached Expiry Calendar
-
Constructor Summary
Constructors Constructor Description CurveDate(ExpiryCalendar calendar, UTCDate date)
CurveDate(ExpiryCalendar calendar, UTCDate date, String timezone)
-
Method Summary
Modifier and Type Method Description AbsolutePeriodCode
getAbsolute(PeriodCode pc)
Convert a relative period code to an absolute period code.UTCDate
getEnd(PeriodCode pc)
UTCDate
getExpiry(PeriodCode pc)
Get the expiry date of a contract.ExpiryCalendar
getExpiryCalendar()
UTCDate
getPeriodStart(PeriodCode pc)
RelativePeriodCode
getRelative(PeriodCode pc)
Convert an absolute period code into a relative period code.UTCDate
getStart(PeriodCode pc)
String
getTimezone()
Calendar
getTradingCalendar()
ZonedDateTime
getZonedDateTime()
UTCDate
minus(long amount, TemporalUnit unit)
UTCDate
minus(Duration duration)
UTCDate
minus(Period period)
UTCDate
plus(long amount, TemporalUnit unit)
UTCDate
plus(Duration duration)
UTCDate
plus(Period period)
CurveDate
setTimezone(String timezone)
String
toONDATE()
Methods inherited from class com.walkfares.calendar.UTCDate
compareTo, equals, get, getDatePart, getDayOfWeek, getDayOfYear, getLocalDate, getLocalDateTime, getTimePart, getZonedDateTime, getZonedDateTime, inTimezone, isAfter, isBefore, of, of, of, of, setUseTime, toDouble, toEpochMilli, toString, useTime, with, with, withString, withTimezone
-
Constructor Details
-
Method Details
-
getExpiryCalendar
-
getTradingCalendar
-
getTimezone
-
setTimezone
-
getZonedDateTime
-
getRelative
Convert an absolute period code into a relative period code. This uses the expiry date and counts back until the curve date is met- Parameters:
pc
- The period code to convert- Returns:
- The relative version of pc
-
getAbsolute
Convert a relative period code to an absolute period code. This method has to make a guess at the absolute period and use getRelative to verify it- Parameters:
pc
- The period code to convert- Returns:
- The absolute version of pc
-
getExpiry
Get the expiry date of a contract.- Parameters:
pc
- The contract period code- Returns:
- The expiry or last trading day of the contract
-
getPeriodStart
-
getStart
-
getEnd
-
plus
-
plus
-
plus
-
minus
-
minus
-
minus
-
toONDATE
-