示例#1
0
  public static Stella_Object accessVizInfoSlotValue(
      VizInfo self, Symbol slotname, Stella_Object value, boolean setvalueP) {
    if (slotname == OntosaurusUtil.SYM_STELLA_STREAM) {
      if (setvalueP) {
        self.stream = ((OutputStream) (value));
      } else {
        value = self.stream;
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_ALLOWED_OBJECTS) {
      if (setvalueP) {
        self.allowedObjects = ((HashSet) (value));
      } else {
        value = self.allowedObjects;
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_SHOW_RELATIONSp) {
      if (setvalueP) {
        self.showRelationsP =
            BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper) (value)));
      } else {
        value = (self.showRelationsP ? Stella.TRUE_WRAPPER : Stella.FALSE_WRAPPER);
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_SHOW_ATTRIBUTESp) {
      if (setvalueP) {
        self.showAttributesP =
            BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper) (value)));
      } else {
        value = (self.showAttributesP ? Stella.TRUE_WRAPPER : Stella.FALSE_WRAPPER);
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_SHOW_RULESp) {
      if (setvalueP) {
        self.showRulesP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper) (value)));
      } else {
        value = (self.showRulesP ? Stella.TRUE_WRAPPER : Stella.FALSE_WRAPPER);
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_ADD_TOPp) {
      if (setvalueP) {
        self.addTopP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper) (value)));
      } else {
        value = (self.addTopP ? Stella.TRUE_WRAPPER : Stella.FALSE_WRAPPER);
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_NODE_COLOR) {
      if (setvalueP) {
        self.nodeColor = ((StringWrapper) (value)).wrapperValue;
      } else {
        value = StringWrapper.wrapString(self.nodeColor);
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_RELATION_COLOR) {
      if (setvalueP) {
        self.relationColor = ((StringWrapper) (value)).wrapperValue;
      } else {
        value = StringWrapper.wrapString(self.relationColor);
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_RELATION_STYLE) {
      if (setvalueP) {
        self.relationStyle = ((StringWrapper) (value)).wrapperValue;
      } else {
        value = StringWrapper.wrapString(self.relationStyle);
      }
    } else if (slotname == OntosaurusUtil.SYM_ONTOSAURUS_FONT_SIZE) {
      if (setvalueP) {
        self.fontSize = ((IntegerWrapper) (value)).wrapperValue;
      } else {
        value = IntegerWrapper.wrapInteger(self.fontSize);
      }
    } 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
  public Cons vizGetBinaryRelationsOf(LogicObject concept) {
    {
      VizInfo self = this;

      {
        MemoizationTable memoTable000 = null;
        Cons memoizedEntry000 = null;
        Stella_Object memoizedValue000 = null;

        if (Stella.$MEMOIZATION_ENABLEDp$) {
          memoTable000 =
              ((MemoizationTable)
                  (OntosaurusUtil
                      .SGT_ONTOSAURUS_M_VIZ_INFOdVIZ_GET_BINARY_RELATIONS_OF_MEMO_TABLE_000
                      .surrogateValue));
          if (memoTable000 == null) {
            Surrogate.initializeMemoizationTable(
                OntosaurusUtil.SGT_ONTOSAURUS_M_VIZ_INFOdVIZ_GET_BINARY_RELATIONS_OF_MEMO_TABLE_000,
                "(:MAX-VALUES 1000 :TIMESTAMPS (:META-KB-UPDATE))");
            memoTable000 =
                ((MemoizationTable)
                    (OntosaurusUtil
                        .SGT_ONTOSAURUS_M_VIZ_INFOdVIZ_GET_BINARY_RELATIONS_OF_MEMO_TABLE_000
                        .surrogateValue));
          }
          memoizedEntry000 =
              MruMemoizationTable.lookupMruMemoizedValue(
                  ((MruMemoizationTable) (memoTable000)),
                  concept,
                  ((Context) (Stella.$CONTEXT$.get())),
                  Stella.MEMOIZED_NULL_VALUE,
                  null,
                  -1);
          memoizedValue000 = memoizedEntry000.value;
        }
        if (memoizedValue000 != null) {
          if (memoizedValue000 == Stella.MEMOIZED_NULL_VALUE) {
            memoizedValue000 = null;
          }
        } else {
          memoizedValue000 =
              Logic.applyCachedRetrieve(
                  Cons.list$(
                      Cons.cons(
                          OntosaurusUtil.SYM_LOGIC_pRELATION,
                          Cons.cons(
                              OntosaurusUtil.SYM_ONTOSAURUS_pDOMAIN,
                              Cons.cons(Stella.NIL, Stella.NIL)))),
                  Cons.list$(
                      Cons.cons(
                          OntosaurusUtil.SYM_STELLA_AND,
                          Cons.cons(
                              Cons.list$(
                                  Cons.cons(
                                      OntosaurusUtil.SYM_PL_KERNEL_KB_NTH_DOMAIN,
                                      Cons.cons(
                                          OntosaurusUtil.SYM_LOGIC_pRELATION,
                                          Cons.cons(
                                              IntegerWrapper.wrapInteger(0),
                                              Cons.cons(
                                                  OntosaurusUtil.SYM_ONTOSAURUS_pDOMAIN,
                                                  Cons.cons(Stella.NIL, Stella.NIL)))))),
                              Cons.cons(
                                  Cons.list$(
                                      Cons.cons(
                                          OntosaurusUtil.SYM_ONTOSAURUS_BINARY_RELATION,
                                          Cons.cons(
                                              OntosaurusUtil.SYM_LOGIC_pRELATION,
                                              Cons.cons(Stella.NIL, Stella.NIL)))),
                                  Cons.cons(Stella.NIL, Stella.NIL))))),
                  Cons.consList(Cons.cons(null, Cons.cons(concept, Stella.NIL))),
                  Cons.consList(
                      Cons.cons(
                          OntosaurusUtil.KWD_SINGLETONSp,
                          Cons.cons(
                              Stella.TRUE_WRAPPER,
                              Cons.cons(
                                  OntosaurusUtil.KWD_INFERENCE_LEVEL,
                                  Cons.cons(OntosaurusUtil.KWD_SHALLOW, Stella.NIL))))),
                  OntosaurusUtil.SYM_ONTOSAURUS_M_VIZ_INFOdVIZ_GET_BINARY_RELATIONS_OF_QUERY_001,
                  new Object[2]);
          if (Stella.$MEMOIZATION_ENABLEDp$) {
            memoizedEntry000.value =
                ((memoizedValue000 == null) ? Stella.MEMOIZED_NULL_VALUE : memoizedValue000);
          }
        }
        {
          Cons value000 = ((Cons) (memoizedValue000));

          return (value000);
        }
      }
    }
  }