org.jfin.date
Class ScheduleGenerator
- java.lang.Object
-
- org.jfin.date.ScheduleGenerator
-
public class ScheduleGenerator extends java.lang.ObjectUtility class for creating an UNADJUSTED schedule between two dates using a given stub type and frequency.
-
-
Constructor Summary
Constructors Constructor and Description ScheduleGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.util.CalendarcopyAndReset(java.util.Calendar calendar)Copy a calendar and reset it's time to midnight to avoid problems relating to generating schedules around midnight.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, Frequency frequency, StubType stubType)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, Frequency frequency, StubType stubType, int maxPeriods)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, Frequency frequency, StubType stubType, Period prototype)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, Frequency frequency, StubType stubType, Period prototype, int maxPeriods)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, int frequencyAmount, int frequencyUnit, StubType stubType)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, int frequencyAmount, int frequencyUnit, StubType stubType, int maxPeriods)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, int frequencyAmount, int frequencyUnit, StubType stubType, Period prototype)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, int frequencyAmount, int frequencyUnit, StubType stubType, Period prototype, int maxPeriods)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.lang.String maturityString, Frequency frequency, StubType stubType)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.lang.String maturityString, Frequency frequency, StubType stubType, int maxPeriods)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.lang.String maturityString, Frequency frequency, StubType stubType, Period prototype)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, java.lang.String maturityString, Frequency frequency, StubType stubType, Period prototype, int maxPeriods)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, Tenor maturity, Frequency frequency, StubType stubType)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, Tenor maturity, Frequency frequency, StubType stubType, int maxPeriods)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, Tenor maturity, Frequency frequency, StubType stubType, Period prototype)Used to generate a List containing an schedule ordered by period dates.static java.util.List<Period>generateSchedule(java.util.Calendar startDate, Tenor maturity, Frequency frequency, StubType stubType, Period prototype, int maxPeriods)Used to generate a List containing an schedule ordered by period dates.static java.lang.StringgetCalendarUnitDescriptor(int calendarUnit)
-
-
-
Method Detail
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.lang.String maturityString, Frequency frequency, StubType stubType) throws ScheduleException, java.text.ParseException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-maturityString- Parsed by Tenor, e.g. "10Y", "6M", etcfrequency-stubType-- Returns:
- A List
containing the schedule - Throws:
ScheduleExceptionjava.text.ParseException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.lang.String maturityString, Frequency frequency, StubType stubType, int maxPeriods) throws ScheduleException, java.text.ParseException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-maturityString- Parsed by Tenor, e.g. "10Y", "6M", etcfrequency-stubType-maxPeriods-- Returns:
- A List
containing the schedule - Throws:
ScheduleExceptionjava.text.ParseException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.lang.String maturityString, Frequency frequency, StubType stubType, Period prototype) throws ScheduleException, java.text.ParseException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-maturityString- Parsed by Tenor, e.g. "10Y", "6M", etcfrequency-stubType-prototype-- Returns:
- A List
containing the schedule - Throws:
ScheduleExceptionjava.text.ParseException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.lang.String maturityString, Frequency frequency, StubType stubType, Period prototype, int maxPeriods) throws ScheduleException, java.text.ParseException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-maturityString- Parsed by Tenor, e.g. "10Y", "6M", etcfrequency-stubType-prototype-- Returns:
- A List
containing the schedule - Throws:
ScheduleExceptionjava.text.ParseException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, Tenor maturity, Frequency frequency, StubType stubType) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-maturity-frequency-stubType-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, Tenor maturity, Frequency frequency, StubType stubType, int maxPeriods) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-maturity-frequency-stubType-maxPeriods-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, Tenor maturity, Frequency frequency, StubType stubType, Period prototype) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-maturity-frequency-stubType-prototype-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, Tenor maturity, Frequency frequency, StubType stubType, Period prototype, int maxPeriods) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-maturity-frequency-stubType-prototype-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, Frequency frequency, StubType stubType) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-endDate-frequency-stubType-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, Frequency frequency, StubType stubType, int maxPeriods) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-endDate-frequency-stubType-maxPeriods-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, Frequency frequency, StubType stubType, Period prototype) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-endDate-frequency-stubType-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, Frequency frequency, StubType stubType, Period prototype, int maxPeriods) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-endDate-frequency-stubType-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, int frequencyAmount, int frequencyUnit, StubType stubType) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-endDate-frequencyAmount-frequencyUnit-stubType-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, int frequencyAmount, int frequencyUnit, StubType stubType, int maxPeriods) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-endDate-frequencyAmount-frequencyUnit-stubType-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, int frequencyAmount, int frequencyUnit, StubType stubType, Period prototype) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-endDate-frequencyAmount-frequencyUnit-stubType-prototype-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
generateSchedule
public static java.util.List<Period> generateSchedule(java.util.Calendar startDate, java.util.Calendar endDate, int frequencyAmount, int frequencyUnit, StubType stubType, Period prototype, int maxPeriods) throws ScheduleException
Used to generate a List containing an schedule ordered by period dates. The periods will be adjacent to each other, e.g: d1,d2 d2,d3 d3,d4- Parameters:
startDate-endDate-frequencyAmount-frequencyUnit-stubType-prototype-maxPeriods-- Returns:
- A List
containing the schedule - Throws:
ScheduleException
-
copyAndReset
public static java.util.Calendar copyAndReset(java.util.Calendar calendar)
Copy a calendar and reset it's time to midnight to avoid problems relating to generating schedules around midnight.- Parameters:
calendar- The calendar to copy and reset- Returns:
- Calendar the calendar which has been copied and reset
-
getCalendarUnitDescriptor
public static java.lang.String getCalendarUnitDescriptor(int calendarUnit)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG