Examples of nextIndex()


Examples of java.util.ListIterator.nextIndex()

        assertTrue( "hasNext", listIter.hasNext() );
        assertEquals( "next index", 0, listIter.nextIndex() );
        assertEquals( "next", fullView[0], listIter.next() );

        assertTrue( "hasNext", listIter.hasNext() );
        assertEquals( "next index", 1, listIter.nextIndex() );
        assertEquals( "next", fullView[1], listIter.next() );

        assertTrue( "hasNext", listIter.hasNext() );
        assertEquals( "next index", 2, listIter.nextIndex() );
        assertEquals( "next", fullView[2], listIter.next() );
View Full Code Here

Examples of java.util.ListIterator.nextIndex()

        assertTrue( "hasNext", listIter.hasNext() );
        assertEquals( "next index", 1, listIter.nextIndex() );
        assertEquals( "next", fullView[1], listIter.next() );

        assertTrue( "hasNext", listIter.hasNext() );
        assertEquals( "next index", 2, listIter.nextIndex() );
        assertEquals( "next", fullView[2], listIter.next() );

        assertFalse( "hasNext", listIter.hasNext() );

        // We are at the end of the list. Go back
View Full Code Here

Examples of java.util.ListIterator.nextIndex()

        List col = createFilterColl(endsView);
        //List col = expectedView;
        assertEquals( "view list size", 3, col.size() );

        ListIterator listIter = col.listIterator(1);
        assertEquals( "next index ", 1, listIter.nextIndex() );
        assertEquals( "previous index", 0, listIter.previousIndex() );

        assertTrue( "hasNext", listIter.hasNext() );
        assertTrue( "hasPrevious", listIter.hasPrevious() );
        assertEquals( "next", fullView[1], listIter.next() );
View Full Code Here

Examples of java.util.ListIterator.nextIndex()

        assertTrue( "hasNext", listIter.hasNext() );
        assertTrue( "hasPrevious", listIter.hasPrevious() );
        assertEquals( "next", fullView[1], listIter.next() );
        assertEquals( "next", fullView[2], listIter.next() );
        assertFalse( "hasNext", listIter.hasNext() );
        assertEquals( "next index ", col.size(), listIter.nextIndex() );

        // We are at the end of the list. Go back
        assertTrue( "hasPrevious", listIter.hasPrevious() );
        assertEquals( "previous index", 2, listIter.previousIndex() );
        assertEquals( "previous", fullView[2], listIter.previous() );
View Full Code Here

Examples of java.util.ListIterator.nextIndex()

            String featString = nameParts[nameParts.length - 1] + "("
                + feats.length + ") ";
            //System.out.println("featString: " + featString);
            if (featExtWeights != null)
            {
              int idx = i.nextIndex() - 1;
              if (idx < featExtWeights.size())
                featString = featExtWeights.get(idx) + "*"
                    + featString;
            }
            file.featureDescriptions.add(featString);
View Full Code Here

Examples of java.util.ListIterator.nextIndex()

        // what features are we adding?
        String featString = fe.getClass().getName() + "(" + 1 + ") ";
        if (featExtWeights != null)
        {
          int idx = i.nextIndex() - 1;
          if (idx < featExtWeights.size())
            featString = featExtWeights.get(idx) + "*" + featString;
        }
        file.featureDescriptions.add(featString);

View Full Code Here

Examples of java.util.ListIterator.nextIndex()

    public void testListIteratorForward() {
        for (int i = 0; i < _lists.length; i++) {
            ListIterator itr = _lists[i].listIterator();
            int count = 0;
            for (; itr.hasNext(); count++) {
                assertEquals(count, itr.nextIndex());
                assertEquals(String.valueOf(count), itr.next());
            }
            assertEquals(100, count);
            try {
                itr.next();
View Full Code Here

Examples of java.util.ListIterator.nextIndex()

    public void testListIteratorIndex() {
        for (int i = 0; i < _lists.length; i++) {
            ListIterator itr = _lists[i].listIterator(50);
            int count = 50;
            for (; itr.hasNext(); count++) {
                assertEquals(count, itr.nextIndex());
                assertEquals(String.valueOf(count), itr.next());
            }
            assertEquals(100, count);
            try {
                itr.next();
View Full Code Here

Examples of java.util.ListIterator.nextIndex()

        // fill sequential list
        int index = 0;
        ListIterator iter;
        for (iter = list.listIterator(0); iter.hasNext();) {
            assertEquals(index, iter.nextIndex());
            assertEquals(index, iter.previousIndex() + 1);
            values2[index] = iter.next();
            assertTrue(list.contains(values2[index]));
            index++;
        }
View Full Code Here

Examples of java.util.ListIterator.nextIndex()

        // fill reverse sequential list
        int back = 0;
        for (iter = list.listIterator(list.size()); iter.hasPrevious();) {
            assertEquals(index, iter.previousIndex() + 1);
            assertEquals(index, iter.nextIndex());
            values3[--index] = iter.previous();
            back++;
        }
        assertEquals(list.size(), back);
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.