/** * Returns a list of relative periods. The name will be dynamic depending on * the dynamicNames argument. The short name will always be dynamic. * * @param periodType the period type. * @param periodNames the array of period names. * @param date the current date. * @param dynamicNames indication of whether dynamic names should be used. * @param format the I18nFormat. * @return a list of periods. */ private List<Period> getRelativePeriodList( CalendarPeriodType periodType, String[] periodNames, Date date, boolean dynamicNames, I18nFormat format ) { return getRelativePeriodList( periodType.generatePeriods( date ), periodNames, dynamicNames, format ); }
/** * Returns a list of relative rolling periods. The name will be dynamic depending on * the dynamicNames argument. The short name will always be dynamic. * * @param periodType the period type. * @param periodNames the array of period names. * @param date the current date. * @param dynamicNames indication of whether dynamic names should be used. * @param format the I18nFormat. * @return a list of periods. */ private List<Period> getRollingRelativePeriodList( CalendarPeriodType periodType, String[] periodNames, Date date, boolean dynamicNames, I18nFormat format ) { return getRelativePeriodList( periodType.generateRollingPeriods( date ), periodNames, dynamicNames, format ); }
periods.addAll( getRelativePeriodList( new WeeklyPeriodType(), WEEKS_THIS_YEAR, date, dynamicNames, format ) ); periods.addAll( getRelativePeriodList( new MonthlyPeriodType(), MONTHS_THIS_YEAR, date, dynamicNames, format ) ); periods.addAll( getRelativePeriodList( new BiMonthlyPeriodType(), BIMONTHS_THIS_YEAR, date, dynamicNames, format ) ); periods.addAll( getRelativePeriodList( new QuarterlyPeriodType(), QUARTERS_THIS_YEAR, date, dynamicNames, format ) ); periods.addAll( getRelativePeriodList( new MonthlyPeriodType(), MONTHS_LAST_YEAR, date, dynamicNames, format ) ); periods.addAll( getRelativePeriodList( new QuarterlyPeriodType(), QUARTERS_LAST_YEAR, date, dynamicNames, format ) );