public MonthlyCalendar(Calendar baseCalendar, TimeZone timeZone) { super(baseCalendar, timeZone); // all days are included by default excludeAll = areAllDaysExcluded(); }
/** * <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 (excludeAll == true) { return false; } // Test the base calendar first. Only if the base calendar not already // excludes the time/date, continue evaluating this calendar instance. if (super.isTimeIncluded(timeStamp) == false) { return false; } java.util.Calendar cl = createJavaCalendar(timeStamp); int day = cl.get(java.util.Calendar.DAY_OF_MONTH); return !(isDayExcluded(day)); }
java.util.Calendar cl = getStartOfDayJavaCalendar(timeStamp); int day = cl.get(java.util.Calendar.DAY_OF_MONTH); if (!isDayExcluded(day)) { return timeStamp; // return the original value while (isDayExcluded(day) == true) { cl.add(java.util.Calendar.DATE, 1); day = cl.get(java.util.Calendar.DAY_OF_MONTH);
/** * <p> * Check if all days are excluded. That is no day is included. * </p> */ public boolean areAllDaysExcluded() { for (int i = 1; i <= MAX_DAYS_IN_MONTH; i++) { if (isDayExcluded(i) == false) { return false; } } return true; }
MonthlyCalendar calendar=new MonthlyCalendar(); if(dates!=null){ for(CalendarDate d:dates){ calendar.setDayExcluded(d.getDayOfMonth(),true);
/** * <p> * Check if all days are excluded. That is no day is included. * </p> */ public boolean areAllDaysExcluded() { for (int i = 1; i <= MAX_DAYS_IN_MONTH; i++) { if (isDayExcluded(i) == false) { return false; } } return true; }
MonthlyCalendar calendar=new MonthlyCalendar(); if(dates!=null){ for(CalendarDate d:dates){ calendar.setDayExcluded(d.getDayOfMonth(),true);
/** * <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 (excludeAll == true) { return false; } // Test the base calendar first. Only if the base calendar not already // excludes the time/date, continue evaluating this calendar instance. if (super.isTimeIncluded(timeStamp) == false) { return false; } java.util.Calendar cl = createJavaCalendar(timeStamp); int day = cl.get(java.util.Calendar.DAY_OF_MONTH); return !(isDayExcluded(day)); }
java.util.Calendar cl = getStartOfDayJavaCalendar(timeStamp); int day = cl.get(java.util.Calendar.DAY_OF_MONTH); if (!isDayExcluded(day)) { return timeStamp; // return the original value while (isDayExcluded(day) == true) { cl.add(java.util.Calendar.DATE, 1); day = cl.get(java.util.Calendar.DAY_OF_MONTH);
public MonthlyCalendar(Calendar baseCalendar, TimeZone timeZone) { super(baseCalendar, timeZone); // all days are included by default excludeAll = areAllDaysExcluded(); }
/** * <p> * Check if all days are excluded. That is no day is included. * </p> */ public boolean areAllDaysExcluded() { for (int i = 1; i <= MAX_DAYS_IN_MONTH; i++) { if (isDayExcluded(i) == false) { return false; } } return true; }
/** * <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 (excludeAll == true) { return false; } // Test the base calendar first. Only if the base calendar not already // excludes the time/date, continue evaluating this calendar instance. if (super.isTimeIncluded(timeStamp) == false) { return false; } java.util.Calendar cl = createJavaCalendar(timeStamp); int day = cl.get(java.util.Calendar.DAY_OF_MONTH); return !(isDayExcluded(day)); }
java.util.Calendar cl = getStartOfDayJavaCalendar(timeStamp); int day = cl.get(java.util.Calendar.DAY_OF_MONTH); if (!isDayExcluded(day)) { return timeStamp; // return the original value while (isDayExcluded(day) == true) { cl.add(java.util.Calendar.DATE, 1); day = cl.get(java.util.Calendar.DAY_OF_MONTH);
/** * <p> * Redefine a certain day of the month to be excluded (true) or included * (false). * </p> * * @param day The day of the month (from 1 to 31) to set. */ public void setDayExcluded(int day, boolean exclude) { if ((day < 1) || (day > MAX_DAYS_IN_MONTH)) { throw new IllegalArgumentException( "The day parameter must be in the range of 1 to " + MAX_DAYS_IN_MONTH); } excludeDays[day - 1] = exclude; excludeAll = areAllDaysExcluded(); }
/** * <p> * Check if all days are excluded. That is no day is included. * </p> */ public boolean areAllDaysExcluded() { for (int i = 1; i <= MAX_DAYS_IN_MONTH; i++) { if (isDayExcluded(i) == false) { return false; } } return true; }
/** * <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 (excludeAll == true) { return false; } // Test the base calendar first. Only if the base calendar not already // excludes the time/date, continue evaluating this calendar instance. if (super.isTimeIncluded(timeStamp) == false) { return false; } java.util.Calendar cl = createJavaCalendar(timeStamp); int day = cl.get(java.util.Calendar.DAY_OF_MONTH); return !(isDayExcluded(day)); }
java.util.Calendar cl = getStartOfDayJavaCalendar(timeStamp); int day = cl.get(java.util.Calendar.DAY_OF_MONTH); if (!isDayExcluded(day)) { return timeStamp; // return the original value while (isDayExcluded(day) == true) { cl.add(java.util.Calendar.DATE, 1); day = cl.get(java.util.Calendar.DAY_OF_MONTH);
/** * <p> * Redefine a certain day of the month to be excluded (true) or included * (false). * </p> * * @param day The day of the month (from 1 to 31) to set. */ public void setDayExcluded(int day, boolean exclude) { if ((day < 1) || (day > MAX_DAYS_IN_MONTH)) { throw new IllegalArgumentException( "The day parameter must be in the range of 1 to " + MAX_DAYS_IN_MONTH); } excludeDays[day - 1] = exclude; excludeAll = areAllDaysExcluded(); }
/** * <p> * Redefine the array of days excluded. The array must non-null and of size * greater or equal to 31. The 0 index element represents the first day of * the month. * </p> */ public void setDaysExcluded(boolean[] days) { if (days == null) { throw new IllegalArgumentException("The days parameter cannot be null."); } if (days.length < MAX_DAYS_IN_MONTH) { throw new IllegalArgumentException( "The days parameter must have a length of at least " + MAX_DAYS_IN_MONTH + " elements."); } excludeDays = days; excludeAll = areAllDaysExcluded(); }
/** * <p> * Redefine the array of days excluded. The array must non-null and of size * greater or equal to 31. The 0 index element represents the first day of * the month. * </p> */ public void setDaysExcluded(boolean[] days) { if (days == null) { throw new IllegalArgumentException("The days parameter cannot be null."); } if (days.length < MAX_DAYS_IN_MONTH) { throw new IllegalArgumentException( "The days parameter must have a length of at least " + MAX_DAYS_IN_MONTH + " elements."); } excludeDays = days; excludeAll = areAllDaysExcluded(); }