Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangTuple


            ArrayList<IErlElement> modules1 = new ArrayList<IErlElement>();
            ArrayList<IErlElement> modules2 = new ArrayList<IErlElement>();

            final OtpErlangObject obj = res.getValue();
            final OtpErlangTuple restuple = (OtpErlangTuple) obj;
            final OtpErlangAtom resindicator = (OtpErlangAtom) restuple.elementAt(0);
            if (resindicator.atomValue().equals("ok")) {
                final OtpErlangTuple listtuple = (OtpErlangTuple) restuple.elementAt(1);
                final OtpErlangList modList1 = (OtpErlangList) listtuple.elementAt(0);
                final OtpErlangList modList2 = (OtpErlangList) listtuple.elementAt(1);
                modules1 = createErlModuleList(modList1);
                modules2 = createErlModuleList(modList2);
            } else {
                final OtpErlangString s = (OtpErlangString) restuple.elementAt(1);
                MessageDialog.openError(shell, "Error", s.stringValue());
View Full Code Here


                        wranglerSelection.getSearchPath(), GlobalParameters.getTabWidth());

        ArrayList<IErlElement> modules = new ArrayList<IErlElement>();
        try {
            final OtpErlangObject obj = res.getValue();
            final OtpErlangTuple restuple = (OtpErlangTuple) obj;
            final OtpErlangAtom resindicator = (OtpErlangAtom) restuple.elementAt(0);
            if (resindicator.atomValue().equals("ok")) {

                final OtpErlangList modList = (OtpErlangList) restuple.elementAt(1);
                modules = createErlModuleList(modList);
            } else {
                final OtpErlangString s = (OtpErlangString) restuple.elementAt(1);
                MessageDialog.openError(shell, "Error", s.stringValue());
                return;
            }
        } catch (final Exception e) {
            ErlLogger.error(e);
View Full Code Here

                    break;
                }
            }
            if (element instanceof DebugTraceEvent) {
                final DebugTraceEvent dt = (DebugTraceEvent) element;
                final OtpErlangTuple t = dt.getTuple();
                final OtpErlangTuple t2 = (OtpErlangTuple) t.elementAt(1);
                switch (columnIndex) {
                case 0:
                    final OtpErlangAtom w = (OtpErlangAtom) t.elementAt(0);
                    final String what = w.atomValue();
                    s = what;
                    break;
                case 1:
                    final OtpErlangTuple ieval = (OtpErlangTuple) t2.elementAt(0);
                    final OtpErlangAtom mod = (OtpErlangAtom) ieval.elementAt(3);
                    final String module = mod.atomValue();
                    final OtpErlangLong lin = (OtpErlangLong) ieval.elementAt(2);
                    s = module;
                    try {
                        final int line = lin.intValue();
                        s += ":" + line; //$NON-NLS-1$
                    } catch (final OtpErlangRangeException e) {
View Full Code Here

            OtpErlangObject msg;
            try {
                msg = mbox.receive(3000);
                if (msg != null) {
                    if (msg instanceof OtpErlangTuple) {
                        final OtpErlangTuple tuple = (OtpErlangTuple) msg;
                        final String tag = ((OtpErlangAtom) tuple.elementAt(0))
                                .atomValue();
                        if ("start".equals(tag)) {
                            callback.start(tuple.elementAt(1));
                        } else if ("stop".equals(tag)) {
                            done = true;
                            callback.stop(tuple.elementAt(1));
                        } else if ("progress".equals(tag)) {
                            callback.progress(tuple.elementAt(1));
                        }
                    }
                }
            } catch (final Exception e) {
                ErlLogger.error(e);
View Full Code Here

        }
        return returnRefsAndOrDefs(refs, defs);
    }

    protected static OtpErlangObject makeIncludePatternObject(final String s) {
        return new OtpErlangTuple(new OtpErlangObject[] { INCLUDE_REF_ATOM,
                new OtpErlangString(s) });
    }
View Full Code Here

            return new OtpErlangList(new OtpErlangObject[] { defs });
        }
    }

    private static OtpErlangTuple make2Tuple(final OtpErlangAtom atom, final String s) {
        return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(s) });
    }
View Full Code Here

    private static final OtpErlangAtom UNDEFINED = new OtpErlangAtom("undefined");

    private static OtpErlangObject make3Tuple(final OtpErlangAtom atom, final String s,
            final int a) {
        if (a >= 0) {
            return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(s),
                    new OtpErlangLong(a) });
        }
        return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(s),
                UNDEFINED });

    }
View Full Code Here

    }

    private static OtpErlangObject make3Tuple(final OtpErlangAtom atom, final String a1,
            final String a2) {
        return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(a1),
                new OtpErlangAtom(a2) });
    }
View Full Code Here

    }

    private static OtpErlangObject make4Tuple(final OtpErlangAtom atom, final String s1,
            final String s2, final int a) {
        if (a >= 0) {
            return new OtpErlangTuple(new OtpErlangObject[] { atom,
                    new OtpErlangAtom(s1), new OtpErlangAtom(s2), new OtpErlangLong(a) });
        }
        return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(s1),
                new OtpErlangAtom(s2), UNDEFINED });
    }
View Full Code Here

        // they should be returned
        assertEquals(2, children.size());
        assertEquals(1, imports2.size());
        assertEquals(1, imports.size());
        final OtpErlangAtom listAtom = new OtpErlangAtom("lists");
        assertEquals(new OtpErlangTuple(new OtpErlangObject[] {
                listAtom,
                new OtpErlangList(new OtpErlangObject[] { makeTuple2("reverse", 1),
                        makeTuple2("foldl", 3) }) }), imports.get(0));
    }
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangTuple

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.