Examples of CharList


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

    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

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

        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

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

        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

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

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

    // ------------------------------------------------------------------------
   
    public void testReadNonEmpty() throws Exception {
        String str = "The quick brown fox jumped over the lazy dogs.";
        CharList list = new ArrayCharList();
        for(int i = 0; i < str.length(); i++) {
            list.add(str.charAt(i));
        }
      
        Reader in = new CharIteratorReader(list.iterator());
        for(int i = 0; i < str.length(); i++) {
            assertEquals(str.charAt(i),in.read());
        }
        assertEquals(-1,in.read());
        assertEquals(-1,in.read());
View Full Code Here

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

        assertEquals(-1,in.read());
        in.close();
    }

    public void testReadEmpty() throws Exception {
        CharList list = new ArrayCharList();
        Reader in = new CharIteratorReader(list.iterator());
        assertEquals(-1,in.read());
        assertEquals(-1,in.read());
        in.close();
    }
View Full Code Here

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

    public void testWrapNull() {
        assertNull(UnmodifiableCharList.wrap(null));
    }

    public void testWrapUnmodifiableCharList() {
        CharList list = makeUnmodifiableCharList();
        assertSame(list,UnmodifiableCharList.wrap(list));
    }
View Full Code Here

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

        CharList list = makeUnmodifiableCharList();
        assertSame(list,UnmodifiableCharList.wrap(list));
    }

    public void testWrapSerializableCharList() {
        CharList list = makeCharList();
        assertTrue(list instanceof Serializable);
        assertTrue(UnmodifiableCharList.wrap(list) instanceof Serializable);
    }
View Full Code Here

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

        assertTrue(list instanceof Serializable);
        assertTrue(UnmodifiableCharList.wrap(list) instanceof Serializable);
    }

    public void testWrapNonSerializableCharList() {
        CharList list = makeCharList();
        CharList ns = list.subList(0,list.size());
        assertTrue(!(ns instanceof Serializable));
        assertTrue(!(UnmodifiableCharList.wrap(ns) instanceof Serializable));
    }
View Full Code Here

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

        return ListCharList.wrap(getList().subList(fromIndex,toIndex));
    }

    public boolean equals(Object obj) {
        if(obj instanceof CharList) {
            CharList that = (CharList)obj;
            if(this == that) {
                return true;
            } else if(this.size() != that.size()) {
                return false;           
            } else {
                CharIterator thisiter = iterator();
                CharIterator thatiter = that.iterator();
                while(thisiter.hasNext()) {
                    if(thisiter.next() != thatiter.next()) {
                        return false;
                    }
                }
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.