示例#1
0
  public boolean lessP(Stella_Object t2) {
    {
      CalendarDate t1 = this;

      if (Surrogate.subtypeOfP(
          Stella_Object.safePrimaryType(t2), Stella.SGT_STELLA_CALENDAR_DATE)) {
        {
          CalendarDate t2000 = ((CalendarDate) (t2));

          if (t1.modifiedJulianDay == t2000.modifiedJulianDay) {
            return (t1.timeMillis < t2000.timeMillis);
          } else {
            return (t1.modifiedJulianDay < t2000.modifiedJulianDay);
          }
        }
      } else {
        {
          OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print(
              "Can't compare calendar date `" + t1 + "' with object `" + t2 + "'");
          throw ((IncompatibleQuantityException)
              (IncompatibleQuantityException.newIncompatibleQuantityException(
                      stream000.theStringReader())
                  .fillInStackTrace()));
        }
      }
    }
  }
示例#2
0
  public Quantity coerceTo(Stella_Object y) {
    {
      CalendarDate x = this;

      if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(y), Stella.SGT_STELLA_CALENDAR_DATE)) {
        {
          CalendarDate y000 = ((CalendarDate) (y));

          return (y000);
        }
      } else {
        {
          OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("Can't coerce `" + y + "' to a CALENDAR-DATE");
          throw ((IncompatibleQuantityException)
              (IncompatibleQuantityException.newIncompatibleQuantityException(
                      stream000.theStringReader())
                  .fillInStackTrace()));
        }
      }
    }
  }