Package java.util

Examples of java.util.ListIterator.nextIndex()


  }

  private void toString(List resources, StringBuffer sb) {
    ListIterator i = resources.listIterator();
    while (i.hasNext()) {
      if (i.nextIndex() != 0) {
        sb.append(", ");
      }
      sb.append(i.next());
    }
  }
View Full Code Here


                  if(!wroteFeatDesc)
                  {
            String featString = fe.getClass().getName() + "(" + feats.length + ") ";
                        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

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

     * @param number the number to add
     */
    private void add(long number) {
        ListIterator i = m_ranges.listIterator();
        while (i.hasNext()) {
            int index = i.nextIndex();
            Range r = (Range) i.next();
            if (r.contains(number)) {
                return;
            }
            long low = r.getLow();
View Full Code Here

    private void injectAfterGivens(Step step) {
        ListIterator i = steps.listIterator(steps.size());
        while (i.hasPrevious()) {
            Object maybeGivenStep = i.previous();
            if (maybeGivenStep instanceof GivenStep) {
                steps.add(i.nextIndex() + 1, step);
                return;
            }
        }
        // if we get here, there weren't any givens
        steps.add(0, step);
View Full Code Here

        // walk all the way back
        walkBackward(expected,testing);

        // forward,back,foward
        while(expected.hasNext()) {
            assertEquals(expected.nextIndex(),testing.nextIndex());
            assertEquals(expected.previousIndex(),testing.previousIndex());
            assertTrue(testing.hasNext());
            assertEquals(expected.next(),testing.next());
            assertTrue(testing.hasPrevious());
            assertEquals(expected.previous(),testing.previous());
View Full Code Here

        walkBackward(expected,testing);

        for(int i=0;i<list.size();i++) {
            // walk forward i
            for(int j=0;j<i;j++) {
                assertEquals(expected.nextIndex(),testing.nextIndex());
                assertEquals(expected.previousIndex(),testing.previousIndex());
                assertTrue(expected.hasNext()); // if this one fails we've got a logic error in the test
                assertTrue(testing.hasNext());
                assertEquals(expected.next(),testing.next());
            }
View Full Code Here

                assertTrue(testing.hasNext());
                assertEquals(expected.next(),testing.next());
            }
            // walk back i/2
            for(int j=0;j<i/2;j++) {
                assertEquals(expected.nextIndex(),testing.nextIndex());
                assertEquals(expected.previousIndex(),testing.previousIndex());
                assertTrue(expected.hasPrevious()); // if this one fails we've got a logic error in the test
                assertTrue(testing.hasPrevious());
                assertEquals(expected.previous(),testing.previous());
            }
View Full Code Here

                assertTrue(testing.hasPrevious());
                assertEquals(expected.previous(),testing.previous());
            }
            // walk foward i/2
            for(int j=0;j<i/2;j++) {
                assertEquals(expected.nextIndex(),testing.nextIndex());
                assertEquals(expected.previousIndex(),testing.previousIndex());
                assertTrue(expected.hasNext()); // if this one fails we've got a logic error in the test
                assertTrue(testing.hasNext());
                assertEquals(expected.next(),testing.next());
            }
View Full Code Here

                assertTrue(testing.hasNext());
                assertEquals(expected.next(),testing.next());
            }
            // walk back i
            for(int j=0;j<i;j++) {
                assertEquals(expected.nextIndex(),testing.nextIndex());
                assertEquals(expected.previousIndex(),testing.previousIndex());
                assertTrue(expected.hasPrevious()); // if this one fails we've got a logic error in the test
                assertTrue(testing.hasPrevious());
                assertEquals(expected.previous(),testing.previous());
            }
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.