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

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


      throw new EvaluationException(this, 2, "undefined");
    } else if (o instanceof Byte || o instanceof Short
        || o instanceof Integer || o instanceof Long) {
      return new IntegerTerm(((Number) o).intValue());
    } else if (o instanceof Float || o instanceof Double) {
      return new DoubleTerm(((Number) o).doubleValue());
    } else if (o instanceof String) {
      return SymbolTerm.makeSymbol((String) o);
    } else if (o instanceof Vector) {
      Vector v = (Vector) o;
      Term t = Prolog.Nil;
View Full Code Here


      switch (type) {
      case 'I':
        token = new IntegerTerm(Integer.parseInt(s.toString()));
        break;
      case 'D':
        token = new DoubleTerm(Double.parseDouble(s.toString()));
        break;
      case 'S':
        char[] chars = s.toString().toCharArray();
        token = Prolog.Nil;
        for (int i = chars.length; i > 0; i--) {
View Full Code Here

        return cont;
      } catch (NumberFormatException e) {
      }
      try {
        if (!a1.unify(
            new DoubleTerm(Double.parseDouble(sb.toString())),
            engine.trail)) {
          return engine.fail();
        }
        return cont;
      } catch (NumberFormatException e) {
View Full Code Here

        return cont;
      } catch (NumberFormatException e) {
      }
      try {
        if (!a1.unify(
            new DoubleTerm(Double.parseDouble(sb.toString())),
            engine.trail)) {
          return engine.fail();
        }
        return cont;
      } catch (NumberFormatException e) {
View Full Code Here

TOP

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

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.