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

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


      out.close();
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    // delete associated entries from the stream manager
    HashMapOfTerm streamManager = engine.getStreamManager();
    if (a1.isSymbol()) {
      streamManager.remove(engine.getStreamManager().get(a1));
      streamManager.remove(a1);
    } else if (a1.isJavaObject()) {
      Term tmp2 = streamManager.get(a1);
      while (!tmp2.isNil()) {
        Term car = ((ListTerm) tmp2).car().dereference();
        if (car.isStructure()) {
          SymbolTerm functor = ((StructureTerm) car).functor();
          Term[] args = ((StructureTerm) car).args();
          if (functor.equals(SYM_ALIAS_1)) {
            Term alias = args[0].dereference();
            streamManager.remove(alias);
          }
        }
        tmp2 = ((ListTerm) tmp2).cdr().dereference();
      }
      streamManager.remove(a1);
    } else {
      throw new IllegalDomainException(this, 1, "stream_or_alias", a1);
    }
    return cont;
  }
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

TOP

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

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.