Package com.ericsson.otp.erlang

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


      for (int j = 0; j < testArg[i].length; j++) {
        assertEquals(testArg[i][j], testResult[i][j]);
      }
    }
    OtpErlangList received = (OtpErlangList) mboxListener.getMsg();
    assertEquals(testArg.length, received.arity());
    for (int i = 0; i < testArg.length; i++) {
      for (int j = 0; j < testArg[i].length; j++) {
        assertEquals(testArg[i][j],
            (((OtpErlangString) ((OtpErlangList) received
                .elementAt(i)).elementAt(j)).stringValue()));
View Full Code Here


    }
      } else if(atomValue.equals("to_neg_int_list")) {
    if (i instanceof OtpErlangString) {
        OtpErlangString oes = (OtpErlangString) i;
        OtpErlangList oel = new OtpErlangList(oes.stringValue());
        int n = oel.arity();
        OtpErlangObject l[] = new OtpErlangObject[n];
        for (int j = 0;  j < n;  j++) {
      OtpErlangLong c = (OtpErlangLong) oel.elementAt(j);
      l[j] = new OtpErlangInt(-c.intValue());
        }
View Full Code Here

              }
              OtpErlangAtom fieldName = (OtpErlangAtom) fd
                  .elementAt(0);
              OtpErlangList fieldValues = (OtpErlangList) fd
                  .elementAt(1);
              if (fieldValues.arity() == 0) {
                jlog.warning("Invalid filter description: "
                    + fd);
                throw new OtpErlangException(
                    "Invalid filter description: " + fd);
              }
View Full Code Here

    OtpErlangPid activePid = getPidValue(elementAt(breakpointReachedMessage, 1));
    OtpErlangList snapshots = getListValue(elementAt(breakpointReachedMessage, 2));
    if (activePid == null || snapshots == null) throw new DebuggerEventFormatException();

    myActivePid = activePid;
    mySnapshots = new ArrayList<ErlangProcessSnapshot>(snapshots.arity());
    for (OtpErlangObject snapshot : snapshots) {
      OtpErlangTuple snapshotTuple = getTupleValue(snapshot); // {Pid, Function, Status, Info, Stack}

      OtpErlangPid pid = getPidValue(elementAt(snapshotTuple, 0));
      ErlangTraceElement init = getTraceElement(getTupleValue(elementAt(snapshotTuple, 1)), null);
View Full Code Here

     *             if thrown if a conversion is not possible, i.e. the type is
     *             not supported
     */
    public <T> List<T> listValue(final ListElementConverter<T> converter) throws ClassCastException {
        final OtpErlangList list = otpObjectToOtpList(value);
        final ArrayList<T> result = new ArrayList<T>(list.arity());
        for (int i = 0; i < list.arity(); ++i) {
            result.add(converter.convert(i, new ErlangValue(list.elementAt(i))));
        }
        return result;
    }
View Full Code Here

     *             not supported
     */
    public <T> List<T> listValue(final ListElementConverter<T> converter) throws ClassCastException {
        final OtpErlangList list = otpObjectToOtpList(value);
        final ArrayList<T> result = new ArrayList<T>(list.arity());
        for (int i = 0; i < list.arity(); ++i) {
            result.add(converter.convert(i, new ErlangValue(list.elementAt(i))));
        }
        return result;
    }

View Full Code Here

        }
        final OtpErlangObject received_raw = connection.doRPC("api_vm", "get_other_vms",
                    new OtpErlangObject[] { ErlangValue.convertToErlang(max) });
        try {
            final OtpErlangList list = ErlangValue.otpObjectToOtpList(received_raw);
            final ArrayList<String> result = new ArrayList<String>(list.arity());
            for (int i = 0; i < list.arity(); ++i) {
                OtpErlangTuple connTuple = ((OtpErlangTuple) list.elementAt(i));
                if (connTuple.arity() != 4) {
                    throw new UnknownException(received_raw);
                }
View Full Code Here

        final OtpErlangObject received_raw = connection.doRPC("api_vm", "get_other_vms",
                    new OtpErlangObject[] { ErlangValue.convertToErlang(max) });
        try {
            final OtpErlangList list = ErlangValue.otpObjectToOtpList(received_raw);
            final ArrayList<String> result = new ArrayList<String>(list.arity());
            for (int i = 0; i < list.arity(); ++i) {
                OtpErlangTuple connTuple = ((OtpErlangTuple) list.elementAt(i));
                if (connTuple.arity() != 4) {
                    throw new UnknownException(received_raw);
                }
                OtpErlangAtom name_otp = (OtpErlangAtom) connTuple.elementAt(i);
View Full Code Here

        final OtpErlangObject received_raw = connection.doRPC("api_monitor", "get_node_info",
                    new OtpErlangObject[] {});
        try {
            final OtpErlangList received = (OtpErlangList) received_raw;
            final Map<String, OtpErlangObject> result = new LinkedHashMap<String, OtpErlangObject>(
                    received.arity());
            for (final OtpErlangObject iter : received) {
                final OtpErlangTuple iter_tpl = (OtpErlangTuple) iter;
                if (iter_tpl.arity() == 2) {
                    final String key = ((OtpErlangAtom) (iter_tpl.elementAt(0))).atomValue();
                    result.put(key, iter_tpl.elementAt(1));
View Full Code Here

        final OtpErlangObject received_raw = connection.doRPC("api_monitor", "get_node_performance",
                    new OtpErlangObject[] {});
        try {
            final OtpErlangList received = (OtpErlangList) received_raw;
            final Map<String, OtpErlangObject> result = new LinkedHashMap<String, OtpErlangObject>(
                    received.arity());
            for (final OtpErlangObject iter : received) {
                final OtpErlangTuple iter_tpl = (OtpErlangTuple) iter;
                if (iter_tpl.arity() == 2) {
                    final String key = ((OtpErlangAtom) (iter_tpl.elementAt(0))).atomValue();
                    result.put(key, iter_tpl.elementAt(1));
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.