コード例 #1
0
  public static boolean isContainedIn(Absence a, ReadableInterval i) {
    if (a.getType() == null || i == null) return false;

    Chronology chron = i.getChronology();

    switch (a.getType()) {
      case Absence:
        return i.contains(a.getInterval(chron));
      case EarlyCheckOut:
        DateTime checkout = a.getCheckout(chron);
        return i.contains(checkout);
      case Tardy:
        DateTime checkin = a.getCheckin(chron);
        return i.contains(checkin);
      default:
        throw new UnsupportedOperationException();
    }
  }
コード例 #2
0
 public boolean isAbsence() {
   return Absence.equals(this);
 }