public class JulianDate extends java.lang.Object implements java.lang.Comparable<JulianDate>
Modifier and Type | Field and Description |
---|---|
static int |
APRIL
Integer Month - April
|
static int |
AUGUST
Integer Month - August
|
static int |
DECEMBER
Integer Month - December
|
static int |
FEBRUARY
Integer Month - February
|
static int |
FRIDAY
Days of the week - Friday
|
static int |
JANUARY
Integer Month - January
|
static int |
JULY
Integer Month - July
|
static int |
JUNE
Integer Month - June
|
static int |
LEFT_INCLUDE
LEFT_INCLUDE includes the start date in the Feb29 check
|
static int |
MARCH
Integer Month - March
|
static int |
MAY
Integer Month - May
|
static int |
MONDAY
Days of the week - Monday
|
static int |
NOVEMBER
Integer Month - November
|
static int |
OCTOBER
Integer Month - October
|
static int |
RIGHT_INCLUDE
RIGHT_INCLUDE includes the end date in the Feb29 check
|
static int |
SATURDAY
Days of the week - Saturday
|
static int |
SEPTEMBER
Integer Month - September
|
static int |
SUNDAY
Days of the week - Sunday
|
static int |
THURSDAY
Days of the week - Thursday
|
static int |
TUESDAY
Days of the week - Tuesday
|
static int |
WEDNESDAY
Days of the week - Wednesday
|
Constructor and Description |
---|
JulianDate(double dblJulian)
Create JulianDate from a double Julian
|
Modifier and Type | Method and Description |
---|---|
JulianDate |
addBusDays(int iDays,
java.lang.String strCalendarSet)
Add the given number of business days and returns a new JulianDate
|
JulianDate |
addDays(int iDays)
Add the given number of days and returns a new JulianDate
|
JulianDate |
addMonths(int iNumMonths)
Add the given number of months and returns a new JulianDate
|
JulianDate |
addTenor(java.lang.String strTenor)
Add the tenor to the JulianDate to create a new date
|
JulianDate |
addTenorAndAdjust(java.lang.String strTenor,
java.lang.String strCalendarSet)
Add the tenor to the JulianDate to create a new business date
|
JulianDate |
addYears(int iNumYears)
Add the given number of years and returns a new JulianDate
|
int |
compareTo(JulianDate dtOther) |
static boolean |
ContainsFeb29(double dblStart,
double dblEnd,
int iIncludeSide)
Indicate whether there is at least one leap day between 2 given Julian dates
|
static JulianDate |
CreateFromDDMMMYYYY(java.lang.String strDate)
Create a JulianDate from a string containing date in the DDMMYYYY format
|
static JulianDate |
CreateFromMDY(java.lang.String strMDY,
java.lang.String strDelim)
Create a JulianDate from a string containing date in the DDMMYYYY format
|
static JulianDate |
CreateFromYMD(int iYear,
int iMonth,
int iDay)
Create a JulianDate from year, month, and date
|
static int |
Day(double dblJulianIn)
Return the day corresponding to the Julian double
|
static java.lang.String |
DayChars(int iDay)
Get the English word for day corresponding to the input integer
|
int |
daysDiff(JulianDate dt)
Difference in days between the current and the input date
|
static int |
DaysElapsed(double dblDate)
Number of days elapsed in the year represented by the given Julian date
|
static int |
DaysInMonth(int iMonth,
int iYear)
Get the maximum number of days in the given month and year
|
static int |
DaysRemaining(double dblDate)
Returns the number of days remaining in the year represented by the given Julian year
|
boolean |
equals(java.lang.Object o) |
static java.lang.String |
fromJulian(double dblJulianIn)
Create a MM/DD/YYYY string from the input Julian double
|
JulianDate |
getFirstCreditIMMStartDate(int iNumRollMonths)
Generate the First Credit IMM roll date from this JulianDate
|
JulianDate |
getFirstEDFStartDate(int iNumRollMonths)
Generate the First EDSF start date from this JulianDate
|
double |
getJulian()
Return the double Julian
|
static java.lang.String |
getMonthOracleChar(int iMonth)
Return the Oracle DB trigram corresponding to the input integer month
|
int |
hashCode() |
static boolean |
IsEOM(double dblDate)
Indicate if the given Julian double corresponds to an end of month day
|
static boolean |
IsLeapYear(double dblDate)
Indicate if the year in the given Julian date is a leap year
|
static int |
Month(double dblJulianIn)
Return the month given the date represented by the Julian double.
|
static java.lang.String |
MonthChar(int iMonth)
Return the English word corresponding to the input integer month
|
static int |
MonthFromMonthChars(java.lang.String strMonth)
Convert the month trigram/word to the corresponding month integer
|
static int |
NumFeb29(double dblStart,
double dblEnd,
int iIncludeSide)
Calculate how many leap days exist between the 2 given Julian days
|
JulianDate |
subtractBusDays(int iDays,
java.lang.String strCalendarSet)
Subtract the given number of business days and returns a new JulianDate
|
JulianDate |
subtractDays(int iDays)
Subtract the given number of days and returns a new JulianDate
|
JulianDate |
subtractTenor(java.lang.String strTenor)
Subtract the tenor to the JulianDate to create a new date
|
static JulianDate |
Today()
Return a Julian Date corresponding to today
|
static double |
toJulian(int iYear,
int iMonth,
int iDay)
Convert YMD to a Julian double.
|
java.lang.String |
toOracleDate()
Return a trigram representation of date
|
java.lang.String |
toString() |
java.lang.String |
toYYYYMMDD(java.lang.String strDelimIn)
Return a representation of date as YYYYMMDD
|
static int |
Year(double dblJulianIn)
Return the Year corresponding to the Julian double
|
public static final int LEFT_INCLUDE
public static final int RIGHT_INCLUDE
public static final int MONDAY
public static final int TUESDAY
public static final int WEDNESDAY
public static final int THURSDAY
public static final int FRIDAY
public static final int SATURDAY
public static final int SUNDAY
public static final int JANUARY
public static final int FEBRUARY
public static final int MARCH
public static final int APRIL
public static final int MAY
public static final int JUNE
public static final int JULY
public static final int AUGUST
public static final int SEPTEMBER
public static final int OCTOBER
public static final int NOVEMBER
public static final int DECEMBER
public JulianDate(double dblJulian) throws java.lang.Exception
dblJulian
- Double representing the JulianDatejava.lang.Exception
- Thrown if the input date is invalidpublic static double toJulian(int iYear, int iMonth, int iDay) throws java.lang.Exception
iYear
- YeariMonth
- MonthiDay
- Dayjava.lang.Exception
- Thrown if the Inputs are invalidpublic static java.lang.String fromJulian(double dblJulianIn)
dblJulianIn
- double representing Julian datepublic static int Year(double dblJulianIn) throws java.lang.Exception
dblJulianIn
- double representing the Julian datejava.lang.Exception
- thrown if the input date in invalidpublic static int Month(double dblJulianIn) throws java.lang.Exception
dblJulianIn
- double representing the Julian datejava.lang.Exception
- thrown if input date is invalidpublic static int Day(double dblJulianIn) throws java.lang.Exception
dblJulianIn
- double representing the Julian datejava.lang.Exception
- thrown if input date is invalidpublic static final int DaysElapsed(double dblDate) throws java.lang.Exception
dblDate
- Double representing the Julian datejava.lang.Exception
- Thrown if the input date is invalidpublic static final int DaysRemaining(double dblDate) throws java.lang.Exception
dblDate
- Double representing the Julian datejava.lang.Exception
- Thrown if input date is invalidpublic static final boolean IsLeapYear(double dblDate) throws java.lang.Exception
dblDate
- Double representing the input Julian datejava.lang.Exception
- Thrown if input date is invalidpublic static final boolean ContainsFeb29(double dblStart, double dblEnd, int iIncludeSide) throws java.lang.Exception
dblStart
- Double representing the starting Julian datedblEnd
- Double representing the ending Julian dateiIncludeSide
- INCLUDE_LEFT or INCLUDE_RIGHT indicating whether the starting date, the ending
date, or both dates are to be includedjava.lang.Exception
- If inputs are invalidpublic static final int NumFeb29(double dblStart, double dblEnd, int iIncludeSide) throws java.lang.Exception
dblStart
- Double representing the starting Julian datedblEnd
- Double representing the ending Julian dateiIncludeSide
- INCLUDE_LEFT or INCLUDE_RIGHT indicating whether the starting date, the ending
date, or both dates are to be includedjava.lang.Exception
- Thrown if the inputs are invalidpublic static final java.lang.String MonthChar(int iMonth) throws java.lang.Exception
iMonth
- Integer representing the monthjava.lang.Exception
- Thrown if the input month is invalidpublic static java.lang.String getMonthOracleChar(int iMonth) throws java.lang.Exception
iMonth
- Integer representing the monthjava.lang.Exception
- thrown if the input month is invalidpublic static final int MonthFromMonthChars(java.lang.String strMonth) throws java.lang.Exception
strMonth
- Month trigram or English Wordjava.lang.Exception
- Thrown on Invalid Input Monthpublic static java.lang.String DayChars(int iDay)
iDay
- Integer representing the dayjava.lang.Exception
- Thrown if the input day is invalidpublic static final int DaysInMonth(int iMonth, int iYear) throws java.lang.Exception
iMonth
- Integer representing the monthiYear
- Integer representing the yearjava.lang.Exception
- Thrown if inputs are invalidpublic static final boolean IsEOM(double dblDate) throws java.lang.Exception
dblDate
- Double representing the Julain datejava.lang.Exception
- Thrown if input date is invalidpublic static final JulianDate Today()
public static final JulianDate CreateFromYMD(int iYear, int iMonth, int iDay)
iYear
- Integer yeariMonth
- Integer monthiDay
- Integer daypublic static final JulianDate CreateFromDDMMMYYYY(java.lang.String strDate)
strDate
- String containing date in the DDMMYYYY formatpublic static final JulianDate CreateFromMDY(java.lang.String strMDY, java.lang.String strDelim)
strMDY
- String containing date in the MM/DD/YYYY formatstrDelim
- String Delimiterpublic double getJulian()
public JulianDate addDays(int iDays)
iDays
- Integer representing the number of days to be addedpublic JulianDate subtractDays(int iDays)
iDays
- Integer representing the number of days to be subtractedpublic JulianDate addBusDays(int iDays, java.lang.String strCalendarSet)
iDays
- Integer representing the number of days to be subtractedstrCalendarSet
- String representing the calendar set containing the business dayspublic JulianDate subtractBusDays(int iDays, java.lang.String strCalendarSet)
iDays
- Integer representing the number of days to be subtractedstrCalendarSet
- String representing the calendar set containing the business dayspublic JulianDate addYears(int iNumYears)
iNumYears
- Integer representing the number of years to be addedpublic JulianDate addMonths(int iNumMonths)
iNumMonths
- Integer representing the number of months to be addedpublic JulianDate getFirstEDFStartDate(int iNumRollMonths)
iNumRollMonths
- Integer representing number of months to rollpublic JulianDate getFirstCreditIMMStartDate(int iNumRollMonths)
iNumRollMonths
- Integer representing number of months to rollpublic JulianDate addTenor(java.lang.String strTenor)
strTenor
- String representing the tenor to addpublic JulianDate addTenorAndAdjust(java.lang.String strTenor, java.lang.String strCalendarSet)
strTenor
- The TenorstrCalendarSet
- The Holiday Calendar Setpublic JulianDate subtractTenor(java.lang.String strTenor)
strTenor
- String representing the tenor to addpublic int daysDiff(JulianDate dt) throws java.lang.Exception
dt
- JulianDate representing the input datejava.lang.Exception
- Thrown if input date is invalidpublic java.lang.String toOracleDate()
public java.lang.String toYYYYMMDD(java.lang.String strDelimIn)
strDelimIn
- Field delimiterpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(JulianDate dtOther)
compareTo
in interface java.lang.Comparable<JulianDate>