コード例 #1
0
ファイル: SetClass.java プロジェクト: rvalimaki/trygve
    @Override
    public RTCode runDetails(final RTObject myEnclosedScope) {
      final RTDynamicScope activationRecord =
          RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
      final RTSetObject theListObject = (RTSetObject) activationRecord.getObject("this");
      final boolean rawResult = theListObject.isEmpty();
      final RTBooleanObject result = new RTBooleanObject(rawResult);

      addRetvalTo(activationRecord);
      activationRecord.setObject("ret$val", result);

      return super.nextCode();
    }
コード例 #2
0
ファイル: SetClass.java プロジェクト: rvalimaki/trygve
    @Override
    public RTCode runDetails(final RTObject myEnclosedScope) {
      final RTDynamicScope activationRecord =
          RunTimeEnvironment.runTimeEnvironment_.currentDynamicScope();
      final RTObject argument = activationRecord.getObject("element");
      final RTSetObject theListObject = (RTSetObject) activationRecord.getObject("this");
      final RTObject result = (RTObject) theListObject.contains(argument);

      addRetvalTo(activationRecord);
      activationRecord.setObject("ret$val", result);

      return super.nextCode();
    }