Examples of previousIndex()


Examples of java.util.ListIterator.previousIndex()

        // 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.previousIndex()

        } // as expected

        // 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

Examples of java.util.ListIterator.previousIndex()

        tryToAdd(list,"element5");
        Object[] values = list.toArray();
        ListIterator iter = list.listIterator();
        for(int i=0;i<values.length;i++) {
            assertEquals("nextIndex should be " + i,i,iter.nextIndex());
            assertEquals("previousIndex should be " + (i-1),i-1,iter.previousIndex());
            assertEquals(values[i],iter.next());
        }
        assertTrue(!iter.hasNext());
        for(int i=values.length-1;i>=0;i--) {
            assertEquals("previousIndex should be " + i,i,iter.previousIndex());
View Full Code Here

Examples of java.util.ListIterator.previousIndex()

            assertEquals("previousIndex should be " + (i-1),i-1,iter.previousIndex());
            assertEquals(values[i],iter.next());
        }
        assertTrue(!iter.hasNext());
        for(int i=values.length-1;i>=0;i--) {
            assertEquals("previousIndex should be " + i,i,iter.previousIndex());
            assertEquals("nextIndex should be " + (i+1),i+1,iter.nextIndex());
            assertEquals(values[i],iter.previous());
        }
    }
View Full Code Here

Examples of java.util.ListIterator.previousIndex()

              this.globalOpenElements);

          if (isAllowed) {

            EventListener el =
                (EventListener) (registeredListeners.get(constraintsIter.previousIndex()));

            if (isElementTag) {
              //it's an element

              ((ElementEventListener) el).elementValueRecieved(
View Full Code Here

Examples of java.util.ListIterator.previousIndex()

            firstElement = (KnuthElement) currParIterator.next();
            //
            if (firstElement.getLayoutManager() != currLM) {
                currLM = (InlineLevelLayoutManager) firstElement.getLayoutManager();
                if (currLM != null) {
                    updateList.add(new Update(currLM, currParIterator.previousIndex()));
                } else {
                    break;
                }
            } else if (currLM == null) {
                break;
View Full Code Here

Examples of java.util.ListIterator.previousIndex()

                    nextElement = (KnuthElement) currParIterator.next();
                    if (nextElement.isBox() && !nextElement.isAuxiliary()) {
                        // a non-auxiliary KnuthBox: append word chars
                        if (currLM != nextElement.getLayoutManager()) {
                            currLM = (InlineLevelLayoutManager) nextElement.getLayoutManager();
                            updateList.add(new Update(currLM, currParIterator.previousIndex()));
                        }
                        // append text to recreate the whole word
                        boxCount++;
                        currLM.getWordChars(sbChars, nextElement.getPosition());
                    } else if (!nextElement.isAuxiliary()) {
View Full Code Here

Examples of java.util.ListIterator.previousIndex()

                        currParIterator.previous();
                        break;
                    } else {
                        if (currLM != nextElement.getLayoutManager()) {
                            currLM = (InlineLevelLayoutManager) nextElement.getLayoutManager();
                            updateList.add(new Update(currLM, currParIterator.previousIndex()));
                        }
                        // an auxiliary KnuthElement: simply ignore it
                        auxCount++;
                    }
                }
View Full Code Here

Examples of java.util.ListIterator.previousIndex()

                index = iterator.nextIndex();
                break;
            }

            if (!arg.startsWith("-")) {
                index = iterator.previousIndex();
                break;
            }

            Option option = (Option) options.get(arg.substring(1));
            if (option == null) {
View Full Code Here

Examples of java.util.ListIterator.previousIndex()

                BlockLevelLayoutManager prevLM = (BlockLevelLayoutManager)
                                                 prevElement.getLayoutManager();
                BlockLevelLayoutManager currLM = (BlockLevelLayoutManager)
                                                 currElement.getLayoutManager();
                returnedList.addAll(prevLM.getChangedKnuthElements(
                        oldList.subList(fromIndex, oldListIterator.previousIndex()), alignment));
                fromIndex = oldListIterator.previousIndex();

                // there is another block after this one
                if (prevLM.mustKeepWithNext()
                    || currLM.mustKeepWithPrevious()) {
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.