コード例 #1
0
ファイル: CalendarDate.java プロジェクト: flovera1/AIWithJava
  public static Stella_Object accessCalendarDateSlotValue(
      CalendarDate self, Symbol slotname, Stella_Object value, boolean setvalueP) {
    if (slotname == Stella.SYM_STELLA_MODIFIED_JULIAN_DAY) {
      if (setvalueP) {
        self.modifiedJulianDay = ((IntegerWrapper) (value)).wrapperValue;
      } else {
        value = IntegerWrapper.wrapInteger(self.modifiedJulianDay);
      }
    } else if (slotname == Stella.SYM_STELLA_TIME_MILLIS) {
      if (setvalueP) {
        self.timeMillis = ((IntegerWrapper) (value)).wrapperValue;
      } else {
        value = IntegerWrapper.wrapInteger(self.timeMillis);
      }
    } else {
      {
        OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        stream000.nativeStream.print("`" + slotname + "' is not a valid case option");
        throw ((StellaException)
            (StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    return (value);
  }
コード例 #2
0
ファイル: CalendarDate.java プロジェクト: flovera1/AIWithJava
  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()));
        }
      }
    }
  }
コード例 #3
0
ファイル: CalendarDate.java プロジェクト: flovera1/AIWithJava
  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()));
        }
      }
    }
  }
コード例 #4
0
  public static Stella_Object accessStellaHashTableSlotValue(
      StellaHashTable self, Symbol slotname, Stella_Object value, boolean setvalueP) {
    if (slotname == Stella.SYM_STELLA_SIZE) {
      if (setvalueP) {
        self.size = ((IntegerWrapper) (value)).wrapperValue;
      } else {
        value = IntegerWrapper.wrapInteger(self.size);
      }
    } else if (slotname == Stella.SYM_STELLA_INITIAL_SIZE) {
      if (setvalueP) {
        self.initialSize = ((IntegerWrapper) (value)).wrapperValue;
      } else {
        value = IntegerWrapper.wrapInteger(self.initialSize);
      }
    } else if (slotname == Stella.SYM_STELLA_FREE_ELEMENTS) {
      if (setvalueP) {
        self.freeElements = ((IntegerWrapper) (value)).wrapperValue;
      } else {
        value = IntegerWrapper.wrapInteger(self.freeElements);
      }
    } else if (slotname == Stella.SYM_STELLA_EQUAL_TESTp) {
      if (setvalueP) {
        self.equalTestP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper) (value)));
      } else {
        value = (self.equalTestP ? Stella.TRUE_WRAPPER : Stella.FALSE_WRAPPER);
      }
    } else {
      {
        OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        stream000.nativeStream.print("`" + slotname + "' is not a valid case option");
        throw ((StellaException)
            (StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    return (value);
  }
コード例 #5
0
  public static Stella_Object accessMemoizationTableSlotValue(
      MemoizationTable self, Symbol slotname, Stella_Object value, boolean setvalueP) {
    if (slotname == Stella.SYM_STELLA_HASH_TABLE) {
      if (setvalueP) {
        self.hashTable = ((IntegerHashTable) (value));
      } else {
        value = self.hashTable;
      }
    } else if (slotname == Stella.SYM_STELLA_TABLE_NAME) {
      if (setvalueP) {
        self.tableName = ((Surrogate) (value));
      } else {
        value = self.tableName;
      }
    } else if (slotname == Stella.SYM_STELLA_CURRENT_TIMESTAMP) {
      if (setvalueP) {
        self.currentTimestamp = ((Cons) (value));
      } else {
        value = self.currentTimestamp;
      }
    } else if (slotname == Stella.SYM_STELLA_TIMESTAMPS) {
      if (setvalueP) {
        self.timestamps = ((Cons) (value));
      } else {
        value = self.timestamps;
      }
    } else {
      {
        OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        stream000.nativeStream.print("`" + slotname + "' is not a valid case option");
        throw ((StellaException)
            (StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    return (value);
  }