Package org.apache.commons.collections.primitives

Examples of org.apache.commons.collections.primitives.CharList


    protected CharList makeEmptyCharList() {
        return new ArrayCharList();
    }
   
    protected CharList makeFullCharList() {
        CharList list = makeEmptyCharList();
        char[] elts = getFullElements();
        for(int i=0;i<elts.length;i++) {
            list.add((char)elts[i]);
        }
        return list;
    }
View Full Code Here


    public void testWrapNull() {
        assertNull(ListCharList.wrap(null));
    }
   
    public void testWrapSerializable() {
        CharList list = ListCharList.wrap(new ArrayList());
        assertNotNull(list);
        assertTrue(list instanceof Serializable);
    }
View Full Code Here

        assertNotNull(list);
        assertTrue(list instanceof Serializable);
    }
   
    public void testWrapNonSerializable() {
        CharList list = ListCharList.wrap(new AbstractList() {
            public Object get(int i) { throw new IndexOutOfBoundsException(); }
            public int size() { return 0; }
        });
        assertNotNull(list);
        assertTrue(!(list instanceof Serializable));
View Full Code Here

    // framework
    // ------------------------------------------------------------------------
    protected abstract CharIterator makeUnmodifiableCharIterator();

    protected CharIterator makeCharIterator() {
        CharList list = new ArrayCharList();
        for(char i=0;i<10;i++) {
            list.add(i);
        }
        return list.iterator();
    }
View Full Code Here

    protected CharIterator makeCharIterator() {
        return makeCharListIterator();
    }
   
    protected CharListIterator makeCharListIterator() {
        CharList list = new ArrayCharList();
        for(char i=0;i<10;i++) {
            list.add(i);
        }
        return list.listIterator();
    }
View Full Code Here

    // ------------------------------------------------------------------------

    protected abstract CharList makeUnmodifiableCharList();

    protected CharList makeCharList() {
        CharList list = new ArrayCharList();
        for(char i=0;i<10;i++) {
            list.add(i);
        }
        return list;
    }
View Full Code Here

    public final void testNotModifiable() throws Exception {
        assertListNotModifiable(makeUnmodifiableCharList());
    }

    public final void testSublistNotModifiable() throws Exception {
        CharList list = makeUnmodifiableCharList();
        assertListNotModifiable(list.subList(0,list.size()-2));
    }
View Full Code Here

        CharList list = makeUnmodifiableCharList();
        assertListNotModifiable(list.subList(0,list.size()-2));
    }
   
    public final void testIteratorNotModifiable() throws Exception {
        CharList list = makeUnmodifiableCharList();
        assertIteratorNotModifiable(list.iterator());
        assertIteratorNotModifiable(list.subList(0,list.size()-2).iterator());
    }
View Full Code Here

        assertIteratorNotModifiable(list.iterator());
        assertIteratorNotModifiable(list.subList(0,list.size()-2).iterator());
    }
   
    public final void testListIteratorNotModifiable() throws Exception {
        CharList list = makeUnmodifiableCharList();
        assertListIteratorNotModifiable(list.listIterator());
        assertListIteratorNotModifiable(list.subList(0,list.size()-2).listIterator());
        assertListIteratorNotModifiable(list.listIterator(1));
        assertListIteratorNotModifiable(list.subList(0,list.size()-2).listIterator(1));
    }
View Full Code Here

    protected CharList makeEmptyCharList() {
        return new ArrayCharList();
    }
   
    protected CharList makeFullCharList() {
        CharList list = makeEmptyCharList();
        char[] elts = getFullElements();
        for(int i=0;i<elts.length;i++) {
            list.add((char)elts[i]);
        }
        return list;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.primitives.CharList

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.