Package jp.ac.kobe_u.cs.prolog.lang

Examples of jp.ac.kobe_u.cs.prolog.lang.JavaObjectTerm


  private Term toPrologTerm(Object obj) {
    if (Term.instanceOfTerm(obj)) {
      return (Term) obj;
    } else {
      return new JavaObjectTerm(obj);
    }
  }
View Full Code Here


        engine.setCurrentInput(engine.getUserInput());
      }
      try {
        in.close();
      } catch (IOException e) {
        throw new TermException(new JavaObjectTerm(e));
      }
    } else if (stream instanceof PrintWriter) {
      PrintWriter out = (PrintWriter) stream;
      if (out.checkError()) {
        if (!forceFlag) {
View Full Code Here

        pArgs = ((StructureTerm) a2).args();
        jArgs = new Object[arity];
        for (int i = 0; i < arity; i++) {
          pArgs[i] = pArgs[i].dereference();
          if (!pArgs[i].isJavaObject()) {
            pArgs[i] = new JavaObjectTerm(pArgs[i]);
          }
          jArgs[i] = pArgs[i].toJava();
        }
        for (Method method : methods) {
          if (method.getName().equals(methodName)
View Full Code Here

  private Term toPrologTerm(Object obj) {
    if (Term.instanceOfTerm(obj)) {
      return (Term) obj;
    } else {
      return new JavaObjectTerm(obj);
    }
  }
View Full Code Here

      pArgs = ((StructureTerm) a1).args();
      jArgs = new Object[arity];
      for (int i = 0; i < arity; i++) {
        pArgs[i] = pArgs[i].dereference();
        if (!pArgs[i].isJavaObject()) {
          pArgs[i] = new JavaObjectTerm(pArgs[i]);
        }
        jArgs[i] = pArgs[i].toJava();
      }
      for (Constructor constr : constrs) {
        if (checkParameterTypes(constr.getParameterTypes(), pArgs)) {
View Full Code Here

  private Term toPrologTerm(Object obj) {
    if (Term.instanceOfTerm(obj)) {
      return (Term) obj;
    } else {
      return new JavaObjectTerm(obj);
    }
  }
View Full Code Here

    a1 = a1.dereference();
    if (!a1.isVariable()) {
      throw new IllegalTypeException(this, 1, "variable", a1);
    }
    Term newHash = new JavaObjectTerm(new HashMapOfTerm());
    a2 = a2.dereference();
    if (a2.isNil()) {
      if (!a1.unify(newHash, engine.trail)) {
        return engine.fail();
      }
View Full Code Here

      if (!a2.unify(t, engine.trail)) {
        return engine.fail();
      }
      return cont;
    } catch (IOException e) {
      throw new TermException(new JavaObjectTerm(e));
    }
  }
View Full Code Here

      if (!a2.unify(new IntegerTerm(c), engine.trail)) {
        return engine.fail();
      }
      return cont;
    } catch (IOException e) {
      throw new TermException(new JavaObjectTerm(e));
    }
  }
View Full Code Here

        pArgs = ((StructureTerm) a2).args();
        jArgs = new Object[arity];
        for (int i = 0; i < arity; i++) {
          pArgs[i] = pArgs[i].dereference();
          if (!pArgs[i].isJavaObject()) {
            pArgs[i] = new JavaObjectTerm(pArgs[i]);
          }
          jArgs[i] = pArgs[i].toJava();
        }
        for (Method method : methods) {
          if (method.getName().equals(methodName)
View Full Code Here

TOP

Related Classes of jp.ac.kobe_u.cs.prolog.lang.JavaObjectTerm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.