Package prefuse.util.collections

Examples of prefuse.util.collections.LiteralIterator


    /*
     * Test method for 'edu.berkeley.guir.prefuse.data.util.IntIntTreeMap.keyIterator()'
     */
    public void testKeyIterator() {
        LiteralIterator iter = map.keyIterator();
        for ( int i=0; iter.hasNext(); ++i ) {
            long key = iter.nextLong();
            assertEquals(sort[i], key);
        }
    }
View Full Code Here


        for ( i=0, k=sort[0]; k==sort[0]; ++i, k=sort[i] );
        k1 = k; i1 = i;
        for ( i=len, k=sort[len]; i>=0 && k==sort[len]; --i, k=sort[i] );
        i2 = i;
       
        LiteralIterator iter = map.keyRangeIterator(k1, true, sort[len], false);
        for ( i=i1; iter.hasNext() && i <= i2; ++i ) {
            assertEquals(iter.nextLong(), sort[i]);
        }
        assertTrue(!iter.hasNext() && i == i2+1);
       
        iter = map.valueRangeIterator(k1, true, sort[len], false);
        for ( i=i1; iter.hasNext() && i <= i2; ++i ) {
            assertEquals(iter.nextInt(), sort[i]);
        }
        assertTrue(!iter.hasNext() && i == i2+1);
    }
View Full Code Here

    /*
     * Test method for 'edu.berkeley.guir.prefuse.data.util.AbstractTreeMap.valueIterator()'
     */
    public void testValueIterator() {
        LiteralIterator iter = map.valueIterator(true);
        for ( int i=0; iter.hasNext(); ++i ) {
            int val = iter.nextInt();
            assertEquals(sort[i], val);
        }
    }
View Full Code Here

TOP

Related Classes of prefuse.util.collections.LiteralIterator

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.