<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>
779803
public void setDaysExcluded (final 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.");
    }

    m_aExcludeDays = days;
    m_aExcludeAll = areAllDaysExcluded ();
  }
664961
private void readCalendar(Calendar calendar)
   {
      ProjectCalendar mpxjCalendar = m_projectFile.addCalendar();
      mpxjCalendar.setName(calendar.getName());
      m_calendarMap.put(calendar.getID(), mpxjCalendar);

      for (WeekDay day : calendar.getWeekDays().getWeekDay())
      {
         readWeekDay(mpxjCalendar, day);
      }

      for (ExceptedDay day : calendar.getExceptedDays().getExceptedDay())
      {
         readExceptionDay(mpxjCalendar, day);
      }
   }
489984
private void splitDays(ProjectCalendar calendar, LinkedList<TimephasedCost> list)
   {
      LinkedList<TimephasedCost> result = new LinkedList<TimephasedCost>();
      boolean remainderInserted = false;

      for (TimephasedCost assignment : list)
      {
         if (remainderInserted)
         {
            assignment.setStart(DateHelper.addDays(assignment.getStart(), 1));
            remainderInserted = false;
         }

         while (assignment != null)
         {
            Date startDay = DateHelper.getDayStartDate(assignment.getStart());
            Date finishDay = DateHelper.getDayStartDate(assignment.getFinish());

            // special case - when the finishday time is midnight, it's really the previous day...
            if (assignment.getFinish().getTime() == finishDay.getTime())
            {
               finishDay = DateHelper.addDays(finishDay, -1);
            }

            if (startDay.getTime() == finishDay.getTime())
            {
               result.add(assignment);
               break;
            }

            TimephasedCost[] split = splitFirstDay(calendar, assignment);
            if (split[0] != null)
            {
               result.add(split[0]);
            }

            if (assignment.equals(split[1]))
            {
               break;
            }

            assignment = split[1];
         }
      }
      
      list.clear();
      list.addAll(result);
   }
151706
@Override
    public void setDate(int parameterIndex, Date x) throws SQLException {
        internalStmt.setDate(parameterIndex, x);
    }
1355158
public void setMonth(int month) {
		calendar.set(Calendar.MONTH, month);
		int maxDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
		
		int adjustedDay = day;
		if (day > maxDays) {
			adjustedDay = maxDays;
			setDay(adjustedDay);
		}

		drawDays();
	}
99855
private void splitDays(ProjectCalendar calendar, LinkedList<TimephasedWork> list)
   {
      LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
      boolean remainderInserted = false;
      
      for (TimephasedWork assignment : list)
      {
         if (remainderInserted)
         {
            assignment.setStart(DateHelper.addDays(assignment.getStart(), 1));
            remainderInserted = false;
         }

         while (assignment != null)
         {
            Date startDay = DateHelper.getDayStartDate(assignment.getStart());
            Date finishDay = DateHelper.getDayStartDate(assignment.getFinish());

            // special case - when the finishday time is midnight, it's really the previous day...
            if (assignment.getFinish().getTime() == finishDay.getTime())
            {
               finishDay = DateHelper.addDays(finishDay, -1);
            }

            if (startDay.getTime() == finishDay.getTime())
            {
               Duration totalWork = assignment.getTotalAmount();
               Duration assignmentWork = getAssignmentWork(calendar, assignment);
               if ((totalWork.getDuration() - assignmentWork.getDuration()) > EQUALITY_DELTA)
               {
                  assignment.setTotalAmount(assignmentWork);
                  result.add(assignment);
                  Duration remainingWork = Duration.getInstance(totalWork.getDuration() - assignmentWork.getDuration(), TimeUnit.MINUTES);
                  
                  Date remainderStart = DateHelper.addDays(finishDay, 1);
                  Date remainderFinish = DateHelper.addDays(remainderStart, 1);
                  
                  TimephasedWork remainder = new TimephasedWork();
                  remainder.setStart(remainderStart);
                  remainder.setFinish(remainderFinish);
                  remainder.setTotalAmount(remainingWork);
                  result.add(remainder);

                  remainderInserted = true;
               }
               else
               {
                  result.add(assignment);
               }
               break;
            }

            TimephasedWork[] split = splitFirstDay(calendar, assignment);
            if (split[0] != null)
            {
               result.add(split[0]);
            }

            if (assignment.equals(split[1]))
            {
               break;
            }

            assignment = split[1];
         }
      }
     
      list.clear();
      list.addAll(result);
   }
981788
public void addExcludedDate (final Date excludedDate)
  {
    final Date date = getStartOfDayJavaCalendar (excludedDate.getTime ()).getTime ();
    /*
     * System.err.println( "HolidayCalendar.add(): date=" +
     * excludedDate.toLocaleString());
     */
    m_aDates.add (date);
  }
1192248
protected final void beginOfMonth(final Calendar c) {
        c.set(Calendar.DAY_OF_MONTH,
                c.getActualMinimum(Calendar.DAY_OF_MONTH));
    }
1007233
static Predicate<DateValue> byMonthDayFilter(final int[] monthDays) {
		return new Predicate<DateValue>() {
			private static final long serialVersionUID = -1618039447294490037L;

			public boolean apply(DateValue date) {
				int nDays = TimeUtils.monthLength(date.year(), date.month());
				for (int i = monthDays.length - 1; i >= 0; i--) {
					int day = monthDays[i];
					if (day < 0) {
						day += nDays + 1;
					}
					if (day == date.day()) {
						return true;
					}
				}
				return false;
			}
		};
	}
860165
public final void setIndividualDates(SortedSet<Date> dates) {

        m_individualDates.clear();
        if (null != dates) {
            m_individualDates.addAll(dates);
        }
        for (Date d : getExceptions()) {
            if (!m_individualDates.contains(d)) {
                m_exceptions.remove(d);
            }
        }

    }
1243368
@Override
  public Container not(final int firstOfRange, final int lastOfRange) {
    // TODO: may need to convert to a RunContainer
    if (firstOfRange >= lastOfRange) {
      return clone(); // empty range
    }

    // determine the span of array indices to be affected
    int startIndex = Util.unsignedBinarySearch(content, 0, cardinality, (short) firstOfRange);
    if (startIndex < 0) {
      startIndex = -startIndex - 1;
    }
    int lastIndex = Util.unsignedBinarySearch(content, 0, cardinality, (short) (lastOfRange - 1));
    if (lastIndex < 0) {
      lastIndex = -lastIndex - 2;
    }
    final int currentValuesInRange = lastIndex - startIndex + 1;
    final int spanToBeFlipped = lastOfRange - firstOfRange;
    final int newValuesInRange = spanToBeFlipped - currentValuesInRange;
    final int cardinalityChange = newValuesInRange - currentValuesInRange;
    final int newCardinality = cardinality + cardinalityChange;

    if (newCardinality > DEFAULT_MAX_SIZE) {
      return toBitmapContainer().not(firstOfRange, lastOfRange);
    }

    ArrayContainer answer = new ArrayContainer(newCardinality);

    // copy stuff before the active area
    System.arraycopy(content, 0, answer.content, 0, startIndex);

    int outPos = startIndex;
    int inPos = startIndex; // item at inPos always >= valInRange

    int valInRange = firstOfRange;
    for (; valInRange < lastOfRange && inPos <= lastIndex; ++valInRange) {
      if ((short) valInRange != content[inPos]) {
        answer.content[outPos++] = (short) valInRange;
      } else {
        ++inPos;
      }
    }

    for (; valInRange < lastOfRange; ++valInRange) {
      answer.content[outPos++] = (short) valInRange;
    }

    // content after the active range
    for (int i = lastIndex + 1; i < cardinality; ++i) {
      answer.content[outPos++] = content[i];
    }
    answer.cardinality = newCardinality;
    return answer;
  }
1235388
public void setStart(int index, Date value)
   {
      set(selectField(ResourceFieldLists.CUSTOM_START, index), value);
   }
460432
public static Day getDay(Integer day)
   {
      Day result = null;
      if (day != null)
      {
         result = DAY_ARRAY[day.intValue()];
      }
      return (result);
   }
1265882
@SuppressWarnings("unused")
    public void setDisabledDays(Calendar[] disabledDays) {
        mDefaultLimiter.setDisabledDays(disabledDays);
        if (mDayPickerView != null) mDayPickerView.onChange();
    }
85146
@NonNull public static CalendarDay from(int year, int month, int day) {
    return new CalendarDay(year, month, day);
  }
343970
private int startIndex(Date start) {
        int lastIndex = ranges.size();

        for (int i = 0; i < ranges.size(); i++) {
            Range r = ranges.get(i);
            if (start.before(r.start)) {
                break;
            }
            lastIndex = i;
        }
        return lastIndex;
    }
1334763
public void setSkipDays(final List<String> skipDays) {
        if (skipDays != null) {
            for (int i = 0; i < skipDays.size(); i++) {
                String day = skipDays.get(i);
                if (day != null) {
                    day = day.toLowerCase();
                    if (!DAYS.contains(day)) {
                        throw new IllegalArgumentException("Invalid day [" + day + "]");
                    }
                    skipDays.set(i, day);
                } else {
                    throw new IllegalArgumentException("Invalid day [null]");
                }
            }
        }
        this.skipDays = skipDays;
    }