/** * <p> * Determine the next time (in milliseconds) that is 'included' by the * Calendar after the given time. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ @Override public long getNextIncludedTime(long timeStamp) { // Call base calendar implementation first long baseTime = super.getNextIncludedTime(timeStamp); if ((baseTime > 0) && (baseTime > timeStamp)) { timeStamp = baseTime; } // Get timestamp for 00:00:00 java.util.Calendar day = getStartOfDayJavaCalendar(timeStamp); while (isTimeIncluded(day.getTime().getTime()) == false) { day.add(java.util.Calendar.DATE, 1); } return day.getTime().getTime(); }
public void removeExcludedDate(Date dateToRemove) { Date date = getStartOfDayJavaCalendar(dateToRemove.getTime()).getTime(); dates.remove(date); }
public Object getObject() { HolidayCalendar holidayCalendar = new HolidayCalendar(); if (this.baseCalendar != null) { holidayCalendar.setBaseCalendar(baseCalendar); } if (this.excludedDates != null) { for (Calendar excludedDate : this.excludedDates) { holidayCalendar.addExcludedDate(excludedDate.getTime()); } } return holidayCalendar; }
private Calendar buildCalendar(CalendarDef calendarDef,Collection<CalendarDate> dates){ CalendarType type=calendarDef.getType(); if(type.equals(CalendarType.holiday)){ HolidayCalendar calendar=new HolidayCalendar(); if(dates!=null){ for(CalendarDate d:dates){ calendar.addExcludedDate(d.getCalendarDate());
public void removeExcludedDate(Date dateToRemove) { Date date = getStartOfDayJavaCalendar(dateToRemove.getTime()).getTime(); dates.remove(date); }
private Calendar buildCalendar(CalendarDef calendarDef,Collection<CalendarDate> dates){ CalendarType type=calendarDef.getType(); if(type.equals(CalendarType.holiday)){ HolidayCalendar calendar=new HolidayCalendar(); if(dates!=null){ for(CalendarDate d:dates){ calendar.addExcludedDate(d.getCalendarDate());
/** * <p> * Determine the next time (in milliseconds) that is 'included' by the * Calendar after the given time. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ @Override public long getNextIncludedTime(long timeStamp) { // Call base calendar implementation first long baseTime = super.getNextIncludedTime(timeStamp); if ((baseTime > 0) && (baseTime > timeStamp)) { timeStamp = baseTime; } // Get timestamp for 00:00:00 java.util.Calendar day = getStartOfDayJavaCalendar(timeStamp); while (isTimeIncluded(day.getTime().getTime()) == false) { day.add(java.util.Calendar.DATE, 1); } return day.getTime().getTime(); }
/** * <p> * Add the given Date to the list of excluded days. Only the month, day and * year of the returned dates are significant. * </p> */ public void addExcludedDate(Date excludedDate) { Date date = getStartOfDayJavaCalendar(excludedDate.getTime()).getTime(); /* * System.err.println( "HolidayCalendar.add(): date=" + * excludedDate.toLocaleString()); */ this.dates.add(date); }
/** * <p> * Determine the next time (in milliseconds) that is 'included' by the * Calendar after the given time. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ public long getNextIncludedTime(long timeStamp) { // Call base calendar implementation first long baseTime = super.getNextIncludedTime(timeStamp); if ((baseTime > 0) && (baseTime > timeStamp)) { timeStamp = baseTime; } // Get timestamp for 00:00:00 java.util.Calendar day = getStartOfDayJavaCalendar(timeStamp); while (isTimeIncluded(day.getTime().getTime()) == false) { day.add(java.util.Calendar.DATE, 1); } return day.getTime().getTime(); }
/** * <p> * Add the given Date to the list of excluded days. Only the month, day and * year of the returned dates are significant. * </p> */ public void addExcludedDate(Date excludedDate) { Date date = getStartOfDayJavaCalendar(excludedDate.getTime()).getTime(); /* * System.err.println( "HolidayCalendar.add(): date=" + * excludedDate.toLocaleString()); */ this.dates.add(date); }
/** * <p> * Determine the next time (in milliseconds) that is 'included' by the * Calendar after the given time. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ public long getNextIncludedTime(long timeStamp) { // Call base calendar implementation first long baseTime = super.getNextIncludedTime(timeStamp); if ((baseTime > 0) && (baseTime > timeStamp)) { timeStamp = baseTime; } // Get timestamp for 00:00:00 java.util.Calendar day = getStartOfDayJavaCalendar(timeStamp); while (isTimeIncluded(day.getTime().getTime()) == false) { day.add(java.util.Calendar.DATE, 1); } return day.getTime().getTime(); }
/** * <p> * Determine whether the given time (in milliseconds) is 'included' by the * Calendar. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ @Override public boolean isTimeIncluded(long timeStamp) { if (super.isTimeIncluded(timeStamp) == false) { return false; } Date lookFor = getStartOfDayJavaCalendar(timeStamp).getTime(); return !(dates.contains(lookFor)); }
/** * <p> * Determine whether the given time (in milliseconds) is 'included' by the * Calendar. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ @Override public boolean isTimeIncluded(long timeStamp) { if (super.isTimeIncluded(timeStamp) == false) { return false; } Date lookFor = getStartOfDayJavaCalendar(timeStamp).getTime(); return !(dates.contains(lookFor)); }
public void removeExcludedDate(Date dateToRemove) { Date date = getStartOfDayJavaCalendar(dateToRemove.getTime()).getTime(); dates.remove(date); }
public void removeExcludedDate(Date dateToRemove) { Date date = getStartOfDayJavaCalendar(dateToRemove.getTime()).getTime(); dates.remove(date); }
/** * <p> * Add the given Date to the list of excluded days. Only the month, day and * year of the returned dates are significant. * </p> */ public void addExcludedDate(Date excludedDate) { Date date = getStartOfDayJavaCalendar(excludedDate.getTime()).getTime(); /* * System.err.println( "HolidayCalendar.add(): date=" + * excludedDate.toLocaleString()); */ this.dates.add(date); }
/** * <p> * Add the given Date to the list of excluded days. Only the month, day and * year of the returned dates are significant. * </p> */ public void addExcludedDate(Date excludedDate) { Date date = getStartOfDayJavaCalendar(excludedDate.getTime()).getTime(); /* * System.err.println( "HolidayCalendar.add(): date=" + * excludedDate.toLocaleString()); */ this.dates.add(date); }
/** * <p> * Determine whether the given time (in milliseconds) is 'included' by the * Calendar. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ public boolean isTimeIncluded(long timeStamp) { if (super.isTimeIncluded(timeStamp) == false) { return false; } Date lookFor = getStartOfDayJavaCalendar(timeStamp).getTime(); return !(dates.contains(lookFor)); }
/** * <p> * Determine whether the given time (in milliseconds) is 'included' by the * Calendar. * </p> * * <p> * Note that this Calendar is only has full-day precision. * </p> */ public boolean isTimeIncluded(long timeStamp) { if (super.isTimeIncluded(timeStamp) == false) { return false; } Date lookFor = getStartOfDayJavaCalendar(timeStamp).getTime(); return !(dates.contains(lookFor)); }