private void setPeriodNames( List<Period> periods, boolean dynamicNames, I18nFormat format ) { for ( Period period : periods ) { RelativePeriods.setName( period, null, dynamicNames, format ); } }
/** * Returns a list of relative periods. The name will be dynamic depending on * the dynamicNames argument. The short name will always be dynamic. * * @param relatives the list of periods. * @param periodNames the array of period names. * @param dynamicNames indication of whether dynamic names should be used. * @param format the I18nFormat. * @return a list of periods. */ private List<Period> getRelativePeriodList( List<Period> relatives, String[] periodNames, boolean dynamicNames, I18nFormat format ) { List<Period> periods = new ArrayList<>(); int c = 0; for ( Period period : relatives ) { periods.add( setName( period, periodNames[c++], dynamicNames, format ) ); } return periods; }
/** * Returns relative period. The name will be dynamic depending on the * dynamicNames argument. The short name will always be dynamic. * * @param periodType the period type. * @param periodName the period name. * @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 Period getRelativePeriod( CalendarPeriodType periodType, String periodName, Date date, boolean dynamicNames, I18nFormat format ) { return setName( periodType.createPeriod( date ), periodName, dynamicNames, format ); }