Examples of arity()


Examples of com.ericsson.otp.erlang.OtpErlangList.arity()

            final OtpErlangObject o = b.get("Payload");
            if (o instanceof OtpErlangString) {
                message = ((OtpErlangString) o).stringValue();
            } else if (o instanceof OtpErlangList) {
                final OtpErlangList l = (OtpErlangList) o;
                if (l.arity() == 0) {
                    message = "";
                } else {
                    try {
                        message = l.stringValue();
                    } catch (final Exception e) {
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangList.arity()

                final OtpErlangObject r = ErlangEngine.getInstance().getProclistService()
                        .getProcessInfo(getBackend().getOtpRpc(), pid);
                if (r instanceof OtpErlangList) {
                    final OtpErlangList l = (OtpErlangList) r;
                    final StringBuilder s = new StringBuilder();
                    for (int i = 0; i < l.arity(); i++) {
                        final OtpErlangTuple e = (OtpErlangTuple) l.elementAt(i);
                        s.append(' ').append(e.elementAt(0).toString()).append("\t= ")
                                .append(e.elementAt(1).toString()).append('\n');
                    }
                    showMessage(s.toString());
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangLong.arity()

                    arity = l.intValue();
                } catch (final OtpErlangRangeException e) {
                }
            } else if (parameters instanceof OtpErlangList) {
                final OtpErlangList l = (OtpErlangList) parameters;
                arity = l.arity();
            }
        }
        name = a.atomValue();
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangMap.arity()

      // #{2 => [],a => 1}
      final OtpErlangMap map = new OtpErlangMap(new OtpInputStream(
      new byte[] { (byte) 131, 116, 0, 0, 0, 2, 97, 2, 106,
             100, 0, 1, 97, 97, 1 }));

      if (map.arity() != 2) {
    fail(5);
      }
      if (!new OtpErlangLong(1).equals(map.get(new OtpErlangAtom("a")))) {
    fail(6);
      }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangTuple.arity()

                if (atomValue.equals(ATOM_TRACE_TS)) {
                    // trace data: {trace_ts, Data}

                    final OtpErlangAtom traceType = (OtpErlangAtom) tuple
                            .elementAt(INDEX_TRACE_TYPE);
                    lastTraceDate = readDateTuple((OtpErlangTuple) tuple.elementAt(tuple
                            .arity() - 1));

                    switch (TraceType.valueOf(traceType.atomValue().toUpperCase())) {
                    case CALL:
                        return processCallTrace("Call", tuple);
View Full Code Here

Examples of com.googlecode.prolog_cafe.lang.Term.arity()

    for (int resultIdx = results.size() - 1; 0 <= resultIdx; resultIdx--) {
      Term submitRecord = results.get(resultIdx);
      SubmitRecord rec = new SubmitRecord();
      out.add(rec);

      if (!submitRecord.isStructure() || 1 != submitRecord.arity()) {
        return logInvalidResult(submitRule, submitRecord);
      }

      if ("ok".equals(submitRecord.name())) {
        rec.status = SubmitRecord.Status.OK;
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.arity()

            for(ExprVar sk:frame.skolems) un.seen(sk.label);
            // Store up the skolems
            List<Object> skolems = new ArrayList<Object>();
            for(Map.Entry<Relation,Type> e: frame.rel2type.entrySet()) {
               Relation r = e.getKey(); if (!frame.eval.instance().contains(r)) continue;
               Type t = e.getValue();   if (t.arity() > r.arity()) continue; // Something is wrong; let's skip it
               while (t.arity() < r.arity()) t = UNIV.type().product(t);
               String n = Util.tail(r.name());
               while(n.length()>0 && n.charAt(0)=='$') n = n.substring(1);
               skolems.add(n);
               skolems.add(t);
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.translator.A4Tuple.arity()

      if (val instanceof String) return "<html> <span" + c + encode((String)val) + "</span></html>";
      if (val instanceof Pair) return "<html> <b" + c + "field " + encode(((ExprHasName)(((Pair<?,?>)val).b)).label) + "</b></html>";
      if (val instanceof A4Tuple) {
         StringBuilder sb = new StringBuilder("<html> <span" + c);
         A4Tuple tp = (A4Tuple) val;
         for(int i=1; i<tp.arity(); i++) {
            if (i>1) sb.append(" -> ");
            sb.append(encode(tp.atom(i)));
         }
         sb.append("</span></html>");
         return sb.toString();
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.translator.A4TupleSet.arity()

    private static SimTupleset convert(Object object) throws Err {
        if (!(object instanceof A4TupleSet)) throw new ErrorFatal("Unexpected type error: expecting an A4TupleSet.");
        A4TupleSet s = (A4TupleSet)object;
        if (s.size()==0) return SimTupleset.EMPTY;
        List<SimTuple> list = new ArrayList<SimTuple>(s.size());
        int arity = s.arity();
        for(A4Tuple t: s) {
            String[] array = new String[arity];
            for(int i=0; i<t.arity(); i++) array[i] = t.atom(i);
            list.add(SimTuple.make(array));
        }
View Full Code Here

Examples of erjang.ETuple.arity()

    EAtom m;
    EAtom f;
    ESeq a;
    ESeq o;
    if ((t=tup.testTuple()) == null
        || t.arity() != 4
        || (m=t.elm(1).testAtom()) == null
        || (f=t.elm(2).testAtom()) == null
        || (a=t.elm(3).testSeq()) == null
        || (o=t.elm(4).testSeq()) == null
        ) throw ERT.badarg(tup);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.