Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangList$SubList


        e.setLineEnd(lastLine);
    }

    private OtpErlangObject concreteTerm(final OtpErlangObject val) {
        if (val instanceof OtpErlangList) {
            final OtpErlangList ll = (OtpErlangList) val;
            final OtpErlangObject[] res = new OtpErlangObject[ll.arity()];
            for (int i = 0; i < ll.arity(); i++) {
                res[i] = concreteTerm(ll.elementAt(i));
            }
            return new OtpErlangList(res);
        }
        try {
            return helper.concreteSyntax(val);
        } catch (final Exception e) {
            return val;
View Full Code Here


        Assert.assertEquals(r.getName(), "hello");
    }

    @Test
    public void list_1() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[]");
        Assert.assertEquals("[]", r.toString());
    }
View Full Code Here

        Assert.assertEquals("[]", r.toString());
    }

    @Test
    public void list_2() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[a,2,b,4]");
        Assert.assertEquals("[a,2,b,4]", r.toString());
    }
View Full Code Here

        Assert.assertEquals("[a,2,b,4]", r.toString());
    }

    @Test
    public void list_3() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[a,2,b|4]");
        Assert.assertEquals("[a,2,b|4]", r.toString());
    }
View Full Code Here

        Assert.assertEquals("[a,2,b|4]", r.toString());
    }

    @Test
    public void list_4() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser
                .parse("[ax , [ 2  , b ], 4 ,5]");
        Assert.assertEquals("[ax,[2,b],4,5]", r.toString());
    }
View Full Code Here

        Assert.assertEquals("[ax,[2,b],4,5]", r.toString());
    }

    @Test
    public void sublist_1() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[a,2,b,4]");
        final OtpErlangList s = (OtpErlangList) termParser.parse("[2,b,4]");
        final OtpErlangObject ss = r.getTail();
        Assert.assertEquals(s, ss);
    }
View Full Code Here

        Assert.assertEquals(s, ss);
    }

    @Test
    public void sublist_2() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3|4]");
        final OtpErlangList s = (OtpErlangList) termParser.parse("[2,3|4]");
        final OtpErlangObject ss = r.getTail();
        Assert.assertEquals(s, ss);
    }
View Full Code Here

        Assert.assertEquals(s, ss);
    }

    @Test
    public void sublist_4() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3,4]");
        final OtpErlangList s = (OtpErlangList) termParser.parse("[3,4]");
        final OtpErlangObject ss = r.getNthTail(2);
        Assert.assertEquals(s, ss);
    }
View Full Code Here

        Assert.assertEquals(s, ss);
    }

    @Test
    public void sublist_3() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3|4]");
        final OtpErlangList s = (OtpErlangList) termParser.parse("[3|4]");
        final OtpErlangObject ss = r.getNthTail(2);
        Assert.assertEquals(s, ss);
    }
View Full Code Here

        Assert.assertEquals(s, ss);
    }

    @Test
    public void sublist_4a() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3,4]");
        final OtpErlangObject ss = r.getNthTail(0);
        Assert.assertEquals(r, ss);
    }
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangList$SubList

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.