Package org.apache.commons.collections.primitives

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


            if(this == that) {
                return true;
            } else if(this.size() != that.size()) {
                return false;           
            } else {
                ShortIterator thisiter = iterator();
                ShortIterator thatiter = that.iterator();
                while(thisiter.hasNext()) {
                    if(thisiter.next() != thatiter.next()) {
                        return false;
                    }
                }
                return true;
            }
View Full Code Here


    // tests
    // ------------------------------------------------------------------------

    public final void testShortIteratorNotModifiable() {
        ShortIterator iter = makeUnmodifiableShortIterator();
        assertTrue(iter.hasNext());
        iter.next();
        try {
            iter.remove();
            fail("Expected UnsupportedOperationException");
        } catch(UnsupportedOperationException e) {
            // expected
        }
    }
View Full Code Here

            // expected
        }
    }

    public final void testIterateShortIterator() {       
        ShortIterator iter = makeUnmodifiableShortIterator();
        for(ShortIterator expected = makeShortIterator(); expected.hasNext(); ) {
            assertTrue(iter.hasNext());
            assertEquals(expected.next(),iter.next());
        }
        assertTrue(! iter.hasNext() );
    }
View Full Code Here

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

    public void testWrapUnmodifiableShortIterator() {
        ShortIterator iter = makeUnmodifiableShortIterator();
        assertSame(iter,UnmodifiableShortIterator.wrap(iter));
    }
View Full Code Here

TOP

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

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.