Package org.apache.commons.collections.primitives

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


        IntList list = makeUnmodifiableIntList();
        assertSame(list,UnmodifiableIntList.wrap(list));
    }

    public void testWrapSerializableIntList() {
        IntList list = makeIntList();
        assertTrue(list instanceof Serializable);
        assertTrue(UnmodifiableIntList.wrap(list) instanceof Serializable);
    }
View Full Code Here


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

    public void testWrapNonSerializableIntList() {
        IntList list = makeIntList();
        IntList ns = list.subList(0,list.size());
        assertTrue(!(ns instanceof Serializable));
        assertTrue(!(UnmodifiableIntList.wrap(ns) instanceof Serializable));
    }
View Full Code Here

        IntList list = makeUnmodifiableIntList();
        assertListNotModifiable(list.subList(0,list.size()-2));
    }
   
    public final void testIteratorNotModifiable() throws Exception {
        IntList list = makeUnmodifiableIntList();
        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 {
        IntList list = makeUnmodifiableIntList();
        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 IntIterator makeIntIterator() {
        return makeIntListIterator();
    }
   
    protected IntListIterator makeIntListIterator() {
        IntList list = new ArrayIntList();
        for(int i=0;i<10;i++) {
            list.add(i);
        }
        return list.listIterator();
    }
View Full Code Here

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

    protected abstract IntList makeUnmodifiableIntList();

    protected IntList makeIntList() {
        IntList list = new ArrayIntList();
        for(int i=0;i<10;i++) {
            list.add(i);
        }
        return list;
    }
View Full Code Here

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

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

    // framework
    // ------------------------------------------------------------------------
    protected abstract IntIterator makeUnmodifiableIntIterator();

    protected IntIterator makeIntIterator() {
        IntList list = new ArrayIntList();
        for(int i=0;i<10;i++) {
            list.add(i);
        }
        return list.iterator();
    }
View Full Code Here

    protected IntList makeEmptyIntList() {
        return new ArrayIntList();
    }
   
    protected IntList makeFullIntList() {
        IntList list = makeEmptyIntList();
        int[] elts = getFullElements();
        for(int i=0;i<elts.length;i++) {
            list.add(elts[i]);
        }
        return list;
    }
View Full Code Here

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

    public boolean equals(Object obj) {
        if(obj instanceof IntList) {
            IntList that = (IntList)obj;
            if(this == that) {
                return true;
            } else if(this.size() != that.size()) {
                return false;           
            } else {
                IntIterator thisiter = iterator();
                IntIterator thatiter = that.iterator();
                while(thisiter.hasNext()) {
                    if(thisiter.next() != thatiter.next()) {
                        return false;
                    }
                }
View Full Code Here

TOP

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

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.