Package java.util

Examples of java.util.ListIterator.previous()


                int newLength = newEntry.getKanaLength();
                ListIterator iterator = list.listIterator();
                while (iterator.hasNext()) {
                    Entry entry = (Entry)iterator.next();
                    if (newLength >= entry.getKanaLength()) {
                        iterator.previous();
                        break;
                    }
                }
                iterator.add(newEntry);
            }
View Full Code Here


    // drop them in reverse order in case db needs it done that way...
    {
      ListIterator itr = auxiliaryDatabaseObjects.listIterator( auxiliaryDatabaseObjects.size() );
      while ( itr.hasPrevious() ) {
        AuxiliaryDatabaseObject object = (AuxiliaryDatabaseObject) itr.previous();
        if ( object.appliesToDialect( dialect ) ) {
          script.add( object.sqlDropString( dialect, defaultCatalog, defaultSchema ) );
        }
      }
    }
View Full Code Here

            return (Action) _actions.getLast();
       
        ListIterator itr = _actions.listIterator(_actions.size());
        Action prev;
        while (itr.hasPrevious()) {
            prev = (Action) itr.previous();
            if (prev.op == Action.GET || prev.op == Action.GET_OUTER
                || prev.op == Action.GET_KEY)
                return prev;
        }
        return null;
View Full Code Here

            return (Action) _actions.getLast();
       
        ListIterator itr = _actions.listIterator(_actions.size());
        Action prev;
        while (itr.hasPrevious()) {
            prev = (Action) itr.previous();
            if (prev.op == Action.GET || prev.op == Action.GET_OUTER
                || prev.op == Action.GET_KEY)
                return prev;
        }
        return null;
View Full Code Here

            ASN1EncodableVector v = new ASN1EncodableVector();

            ListIterator iter = certificates.listIterator(certificates.size());
            while (iter.hasPrevious())
            {
                v.add(toASN1Object((X509Certificate)iter.previous()));
            }

            return toDEREncoded(new DERSequence(v));
        }
        else if (encoding.equalsIgnoreCase("PKCS7"))
View Full Code Here

        String lastOrderedDocumentName = null;
        int lastOrderedDocumentIndex = -1;
        while (decrement ? orderIter.hasNext() : orderIter.hasPrevious())
        {
            int orderedDocumentIndex = (decrement ? orderIter.nextIndex() : orderIter.previousIndex());
            String orderedDocumentName = (String)(decrement ? orderIter.next() : orderIter.previous());
            if (orderedDocumentName.equals(documentName))
            {
                boolean update = false;
                if (lastOrderedDocumentIndex != -1)
                {
View Full Code Here

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

        // ensure NoSuchElementException is thrown as appropriate
View Full Code Here

        }
        assertEquals(list.size(), back);

        // ensure NoSuchElementException is thrown as appropriate
        try {
            iter.previous();
            fail("previous() should have resulted in a "
                + "NoSuchElementException");
        } catch (NoSuchElementException e) {
        } // as expected
View Full Code Here

        }
        assertTrue(!iter.hasNext());
        for(int i=values.length-1;i>=0;i--) {
            assertTrue( iter.hasPrevious() );
            assertTrue((i!=(values.length-1)) == iter.hasNext());
            assertEquals(values[i],iter.previous());
        }
        assertTrue(!iter.hasPrevious());
        for(int i=0;i<values.length;i++) {
            assertTrue( iter.hasNext() );
            assertTrue((i!=0) == iter.hasPrevious());
View Full Code Here

        assertTrue(!iter.hasPrevious());
        for(int i=0;i<values.length;i++) {
            assertTrue( iter.hasNext() );
            assertTrue((i!=0) == iter.hasPrevious());
            assertEquals(values[i],iter.next());
            assertEquals(values[i],iter.previous());
            assertEquals(values[i],iter.next());
        }
    }

    public void testListListIteratorNextIndexPrevIndex() {
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.