Package com.ericsson.otp.erlang

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


        final int year = ((OtpErlangLong) dateTuple.elementAt(0)).intValue();
        final int month = ((OtpErlangLong) dateTuple.elementAt(1)).intValue() - 1;
        final int day = ((OtpErlangLong) dateTuple.elementAt(2)).intValue();
        final int hour = ((OtpErlangLong) timeTuple.elementAt(0)).intValue();
        final int minute = ((OtpErlangLong) timeTuple.elementAt(1)).intValue();
        final int second = ((OtpErlangLong) timeTuple.elementAt(2)).intValue();

        final Calendar calendar = Calendar.getInstance();
        calendar.set(year, month, day, hour, minute, second);

        return calendar.getTime();
View Full Code Here


            // pid
            OtpErlangPid pid = null;
            if (processTuple.arity() == 3) {
                // {Pid(), Initial_call()|Registered_name(), Node()}
                pid = (OtpErlangPid) processTuple.elementAt(INDEX_PROCESS_PID);
                pidNode = new TreeNode("pid: " + pid2Str(pid),
                        Activator.getImage(Images.INFO_NODE));
            } else {
                index = 1;// tuple doesn't contain Pid element
            }
View Full Code Here

                        Activator.getImage(Images.INFO_NODE));
            } else {
                index = 1;// tuple doesn't contain Pid element
            }

            final OtpErlangObject info = processTuple.elementAt(INDEX_PROCESS_INFO
                    - index);

            // process node
            final OtpErlangObject processNode = processTuple.elementAt(INDEX_PROCESS_NODE
                    - index);
View Full Code Here

            final OtpErlangObject info = processTuple.elementAt(INDEX_PROCESS_INFO
                    - index);

            // process node
            final OtpErlangObject processNode = processTuple.elementAt(INDEX_PROCESS_NODE
                    - index);
            processNodeNode = new TreeNode("node: " + processNode,
                    Activator.getImage(Images.INFO_NODE));

            if (info instanceof OtpErlangTuple) {
View Full Code Here

    private ITreeNode createFunctionNode(final String label,
            final OtpErlangObject erlangObject) {
        final ITreeNode node = new TreeNode();
        if (erlangObject instanceof OtpErlangTuple) {
            final OtpErlangTuple functionTuple = (OtpErlangTuple) erlangObject;
            final OtpErlangAtom moduleName = (OtpErlangAtom) functionTuple
                    .elementAt(INDEX_FUNCTION_MODULE);
            final OtpErlangAtom functionName = (OtpErlangAtom) functionTuple
                    .elementAt(INDEX_FUNCTION_NAME);

            // args or arity node
View Full Code Here

        final ITreeNode node = new TreeNode();
        if (erlangObject instanceof OtpErlangTuple) {
            final OtpErlangTuple functionTuple = (OtpErlangTuple) erlangObject;
            final OtpErlangAtom moduleName = (OtpErlangAtom) functionTuple
                    .elementAt(INDEX_FUNCTION_MODULE);
            final OtpErlangAtom functionName = (OtpErlangAtom) functionTuple
                    .elementAt(INDEX_FUNCTION_NAME);

            // args or arity node
            final TreeNode argsNode = new TreeNode();
            argsNode.setImage(Activator.getImage(Images.INFO_NODE));
View Full Code Here

                    .elementAt(INDEX_FUNCTION_NAME);

            // args or arity node
            final TreeNode argsNode = new TreeNode();
            argsNode.setImage(Activator.getImage(Images.INFO_NODE));
            final OtpErlangObject arityOrArgs = functionTuple
                    .elementAt(INDEX_FUNCTION_ARGS);
            int arityValue = -1;
            if (arityOrArgs instanceof OtpErlangList) {
                // last element is a list of arguments
                final OtpErlangList arguments = (OtpErlangList) arityOrArgs;
View Full Code Here

                arityValue = arguments.arity() - 1;
                argsNode.setLabel(builder.substring(0, builder.length() - 2));
            } else {
                // last element is arity
                try {
                    if (functionTuple.elementAt(INDEX_FUNCTION_ARGS) instanceof OtpErlangInt) {
                        arityValue = ((OtpErlangInt) functionTuple
                                .elementAt(INDEX_FUNCTION_ARGS)).intValue();
                    } else {
                        arityValue = (int) ((OtpErlangLong) functionTuple
                                .elementAt(INDEX_FUNCTION_ARGS)).longValue();
View Full Code Here

                argsNode.setLabel(builder.substring(0, builder.length() - 2));
            } else {
                // last element is arity
                try {
                    if (functionTuple.elementAt(INDEX_FUNCTION_ARGS) instanceof OtpErlangInt) {
                        arityValue = ((OtpErlangInt) functionTuple
                                .elementAt(INDEX_FUNCTION_ARGS)).intValue();
                    } else {
                        arityValue = (int) ((OtpErlangLong) functionTuple
                                .elementAt(INDEX_FUNCTION_ARGS)).longValue();
                    }
View Full Code Here

                try {
                    if (functionTuple.elementAt(INDEX_FUNCTION_ARGS) instanceof OtpErlangInt) {
                        arityValue = ((OtpErlangInt) functionTuple
                                .elementAt(INDEX_FUNCTION_ARGS)).intValue();
                    } else {
                        arityValue = (int) ((OtpErlangLong) functionTuple
                                .elementAt(INDEX_FUNCTION_ARGS)).longValue();
                    }
                    argsNode.setLabel("arity: " + arityValue);
                } catch (final OtpErlangRangeException e) {
                    ErlLogger.error(e);
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.