Package com.ericsson.otp.erlang

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


                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());
                } else {
                    showMessage("Process " + pid.toString()
View Full Code Here


                    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());
                } else {
                    showMessage("Process " + pid.toString()
                            + " is probably dead.\nPlease refresh process list.");
View Full Code Here

    static class ViewLabelProvider extends LabelProvider implements ITableLabelProvider {

        @Override
        public String getColumnText(final Object obj, final int index) {
            final OtpErlangTuple t = (OtpErlangTuple) obj;
            final OtpErlangObject e = t.elementAt(index + 1);
            if (e instanceof OtpErlangString) {
                return ((OtpErlangString) e).stringValue();
            }
            return e.toString();
        }
View Full Code Here

        }
    }

    private void handleMessage(final OtpErlangObject msg) {
        final OtpErlangTuple tuple = (OtpErlangTuple) msg;
        final String tag = ((OtpErlangAtom) tuple.elementAt(0)).atomValue();
        if ("io_request".equals(tag)) {
            final OtpErlangPid from = (OtpErlangPid) tuple.elementAt(1);
            final OtpErlangObject replyAs = tuple.elementAt(2);
            final OtpErlangTuple request = (OtpErlangTuple) tuple.elementAt(3);
            final OtpErlangObject reply = processRequest(from, request);
View Full Code Here

    private void handleMessage(final OtpErlangObject msg) {
        final OtpErlangTuple tuple = (OtpErlangTuple) msg;
        final String tag = ((OtpErlangAtom) tuple.elementAt(0)).atomValue();
        if ("io_request".equals(tag)) {
            final OtpErlangPid from = (OtpErlangPid) tuple.elementAt(1);
            final OtpErlangObject replyAs = tuple.elementAt(2);
            final OtpErlangTuple request = (OtpErlangTuple) tuple.elementAt(3);
            final OtpErlangObject reply = processRequest(from, request);
            final OtpErlangTuple replyMsg = OtpErlang.mkTuple(new OtpErlangAtom(
                    "io_reply"), replyAs, reply);
View Full Code Here

    private void handleMessage(final OtpErlangObject msg) {
        final OtpErlangTuple tuple = (OtpErlangTuple) msg;
        final String tag = ((OtpErlangAtom) tuple.elementAt(0)).atomValue();
        if ("io_request".equals(tag)) {
            final OtpErlangPid from = (OtpErlangPid) tuple.elementAt(1);
            final OtpErlangObject replyAs = tuple.elementAt(2);
            final OtpErlangTuple request = (OtpErlangTuple) tuple.elementAt(3);
            final OtpErlangObject reply = processRequest(from, request);
            final OtpErlangTuple replyMsg = OtpErlang.mkTuple(new OtpErlangAtom(
                    "io_reply"), replyAs, reply);
            mbox.send(from, replyMsg);
View Full Code Here

        }
        Bindings b;
        try {
            if (arequest instanceof OtpErlangTuple) {
                final OtpErlangTuple request = (OtpErlangTuple) arequest;
                final String tag = ((OtpErlangAtom) request.elementAt(0)).atomValue();
                if ("put_chars".equals(tag)) {
                    b = OtpErlang.match("{put_chars, Chars}", request);
                    if (b != null) {
                        return callback.putChars(from, IOEncoding.latin1, b.get("Chars"));
                    }
View Full Code Here

                final IOtpRpc backend = getBackend();
                final OtpErlangTuple tuple = (OtpErlangTuple) backend.call(
                        Constants.ERLANG_HELPER_MODULE, Constants.FUN_STR2MS, "s",
                        new OtpErlangString(newText));
                if (((OtpErlangAtom) tuple.elementAt(0)).atomValue().equals("ok")) {
                    // correct match spec - update
                    ((MatchSpec) getValue()).setFunctionString(newText);
                    ((MatchSpec) getValue()).setMsObject(tuple.elementAt(1));
                    return null;
                }
View Full Code Here

                        Constants.ERLANG_HELPER_MODULE, Constants.FUN_STR2MS, "s",
                        new OtpErlangString(newText));
                if (((OtpErlangAtom) tuple.elementAt(0)).atomValue().equals("ok")) {
                    // correct match spec - update
                    ((MatchSpec) getValue()).setFunctionString(newText);
                    ((MatchSpec) getValue()).setMsObject(tuple.elementAt(1));
                    return null;
                }
                // incorrect match spec
                final OtpErlangAtom errorType = (OtpErlangAtom) tuple.elementAt(1);
                if (errorType.atomValue().equals("standard_info")) {
View Full Code Here

                    ((MatchSpec) getValue()).setFunctionString(newText);
                    ((MatchSpec) getValue()).setMsObject(tuple.elementAt(1));
                    return null;
                }
                // incorrect match spec
                final OtpErlangAtom errorType = (OtpErlangAtom) tuple.elementAt(1);
                if (errorType.atomValue().equals("standard_info")) {
                    final OtpErlangTuple errorTuple = (OtpErlangTuple) tuple.elementAt(2);
                    final StringBuilder builder = new StringBuilder("Line ");
                    builder.append(errorTuple.elementAt(0)).append(": ");
                    final OtpErlangList errorList = (OtpErlangList) errorTuple
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.