Cleanup of iterators package.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1366797 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e5f105dab9
commit
922da12f3f
|
@ -22,9 +22,7 @@ import java.util.NoSuchElementException;
|
|||
* Provides an implementation of an empty iterator.
|
||||
*
|
||||
* @since 3.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
abstract class AbstractEmptyIterator<E> {
|
||||
|
||||
|
|
|
@ -24,10 +24,7 @@ import java.util.Iterator;
|
|||
* All methods are forwarded to the decorated iterator.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author James Strachan
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public abstract class AbstractIteratorDecorator<E> extends AbstractUntypedIteratorDecorator<E, E> {
|
||||
|
||||
|
|
|
@ -24,10 +24,7 @@ import java.util.ListIterator;
|
|||
* All methods are forwarded to the decorated list iterator.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Rodney Waldhoff
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AbstractListIteratorDecorator<E> implements ListIterator<E> {
|
||||
|
||||
|
|
|
@ -24,9 +24,7 @@ import org.apache.commons.collections.MapIterator;
|
|||
* All methods are forwarded to the decorated map iterator.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AbstractMapIteratorDecorator<K, V> implements MapIterator<K, V> {
|
||||
|
||||
|
|
|
@ -24,9 +24,7 @@ import org.apache.commons.collections.OrderedMapIterator;
|
|||
* All methods are forwarded to the decorated map iterator.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AbstractOrderedMapIteratorDecorator<K, V> implements OrderedMapIterator<K, V> {
|
||||
|
||||
|
|
|
@ -33,13 +33,7 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* the iterator back to the start if required.
|
||||
*
|
||||
* @since 1.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author James Strachan
|
||||
* @author Mauricio S. Moura
|
||||
* @author Michael A. Smith
|
||||
* @author Neil O'Toole
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ArrayIterator<E> implements ResettableIterator<E> {
|
||||
|
||||
|
|
|
@ -38,11 +38,7 @@ import org.apache.commons.collections.ResettableListIterator;
|
|||
* @see java.util.ListIterator
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Neil O'Toole
|
||||
* @author Stephen Colebourne
|
||||
* @author Phil Steitz
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ArrayListIterator<E> extends ArrayIterator<E>
|
||||
implements ListIterator<E>, ResettableListIterator<E> {
|
||||
|
|
|
@ -36,10 +36,7 @@ import org.apache.commons.collections.list.UnmodifiableList;
|
|||
* lesser of <code>A.next()</code> and <code>B.next()</code>.
|
||||
*
|
||||
* @since 2.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Rodney Waldhoff
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class CollatingIterator<E> implements Iterator<E> {
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* 2.1.1 and 3.1 due to issues with <code>IteratorUtils</code>.
|
||||
*
|
||||
* @since 2.1.1 and 3.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EmptyIterator<E> extends AbstractEmptyIterator<E> implements ResettableIterator<E> {
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ import org.apache.commons.collections.ResettableListIterator;
|
|||
* due to issues with <code>IteratorUtils</code>.
|
||||
*
|
||||
* @since 2.1.1 and 3.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EmptyListIterator<E> extends AbstractEmptyIterator<E> implements
|
||||
ResettableListIterator<E> {
|
||||
|
|
|
@ -23,9 +23,7 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* Provides an implementation of an empty map iterator.
|
||||
*
|
||||
* @since 3.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EmptyMapIterator<K, V> extends AbstractEmptyMapIterator<K, V> implements
|
||||
MapIterator<K, V>, ResettableIterator<K> {
|
||||
|
|
|
@ -23,11 +23,10 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* Provides an implementation of an empty ordered iterator.
|
||||
*
|
||||
* @since 3.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EmptyOrderedIterator<E> extends AbstractEmptyIterator<E> implements OrderedIterator<E>, ResettableIterator<E> {
|
||||
public class EmptyOrderedIterator<E> extends AbstractEmptyIterator<E>
|
||||
implements OrderedIterator<E>, ResettableIterator<E> {
|
||||
|
||||
/**
|
||||
* Singleton instance of the iterator.
|
||||
|
|
|
@ -23,12 +23,10 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* Provides an implementation of an empty ordered map iterator.
|
||||
*
|
||||
* @since 3.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EmptyOrderedMapIterator<K, V> extends AbstractEmptyMapIterator<K, V> implements
|
||||
OrderedMapIterator<K, V>, ResettableIterator<K> {
|
||||
public class EmptyOrderedMapIterator<K, V> extends AbstractEmptyMapIterator<K, V>
|
||||
implements OrderedMapIterator<K, V>, ResettableIterator<K> {
|
||||
|
||||
/**
|
||||
* Singleton instance of the iterator.
|
||||
|
|
|
@ -35,9 +35,7 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* </pre>
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EntrySetMapIterator<K, V> implements MapIterator<K, V>, ResettableIterator<K> {
|
||||
|
||||
|
|
|
@ -25,10 +25,7 @@ import java.util.Iterator;
|
|||
* to be {@link Iterator Iterator} instances.
|
||||
*
|
||||
* @since 1.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
||||
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EnumerationIterator<E> implements Iterator<E> {
|
||||
|
||||
|
|
|
@ -28,12 +28,7 @@ import org.apache.commons.collections.Predicate;
|
|||
* those elements that match the specified {@link Predicate Predicate}.
|
||||
*
|
||||
* @since 1.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author James Strachan
|
||||
* @author Jan Sorensen
|
||||
* @author Ralph Wagner
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class FilterIterator<E> implements Iterator<E> {
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ import org.apache.commons.collections.Predicate;
|
|||
* those elements that match the specified {@link Predicate Predicate}.
|
||||
*
|
||||
* @since 2.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Rodney Waldhoff
|
||||
* @version $Id$
|
||||
*/
|
||||
public class FilterListIterator<E> implements ListIterator<E> {
|
||||
|
||||
|
|
|
@ -44,11 +44,7 @@ import org.apache.commons.collections.list.UnmodifiableList;
|
|||
* this case the class will function as an empty iterator.
|
||||
*
|
||||
* @since 2.1
|
||||
* @version $Revision$
|
||||
* 2006) $
|
||||
*
|
||||
* @author Morgan Delagrange
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class IteratorChain<E> implements Iterator<E> {
|
||||
|
||||
|
|
|
@ -24,9 +24,7 @@ import java.util.Iterator;
|
|||
* {@link Enumeration Enumeration} instance.
|
||||
*
|
||||
* @since 1.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class IteratorEnumeration<E> implements Enumeration<E> {
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* </p>
|
||||
*
|
||||
* @since 4.0
|
||||
* @version $Revision$
|
||||
* @version $Id$
|
||||
*/
|
||||
public class IteratorIterable<E> implements Iterable<E> {
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.List;
|
|||
import java.util.ListIterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.apache.commons.collections.ResettableIterator;
|
||||
import org.apache.commons.collections.ResettableListIterator;
|
||||
|
||||
/**
|
||||
|
@ -43,11 +42,7 @@ import org.apache.commons.collections.ResettableListIterator;
|
|||
* This class implements ResettableListIterator from Commons Collections 3.2.
|
||||
*
|
||||
* @since 2.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Morgan Delagrange
|
||||
* @author Stephen Colebourne
|
||||
* @author Matt Benson
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ListIteratorWrapper<E> implements ResettableListIterator<E> {
|
||||
|
||||
|
|
|
@ -33,10 +33,7 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* implementations will throw a ConcurrentModificationException.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author <a href="mailto:joncrlsn@users.sf.net">Jonathan Carlson</a>
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class LoopingIterator<E> implements ResettableIterator<E> {
|
||||
|
||||
|
|
|
@ -35,9 +35,7 @@ import org.apache.commons.collections.ResettableListIterator;
|
|||
* ConcurrentModificationException.
|
||||
*
|
||||
* @since 3.2
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Eric Crampton <ccesc@eonomine.com>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class LoopingListIterator<E> implements ResettableListIterator<E> {
|
||||
|
||||
|
|
|
@ -31,14 +31,7 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* back to the start if required.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author James Strachan
|
||||
* @author Mauricio S. Moura
|
||||
* @author Michael A. Smith
|
||||
* @author Neil O'Toole
|
||||
* @author Stephen Colebourne
|
||||
* @author Phil Steitz
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ObjectArrayIterator<E>
|
||||
implements Iterator<E>, ResettableIterator<E> {
|
||||
|
|
|
@ -35,11 +35,7 @@ import org.apache.commons.collections.ResettableListIterator;
|
|||
* @see java.util.ListIterator
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Neil O'Toole
|
||||
* @author Stephen Colebourne
|
||||
* @author Phil Steitz
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
|
||||
implements ListIterator<E>, ResettableListIterator<E> {
|
||||
|
|
|
@ -71,9 +71,7 @@ import org.apache.commons.collections.Transformer;
|
|||
* more efficient (and convenient) than using nested for loops to extract a list.
|
||||
*
|
||||
* @since 3.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ObjectGraphIterator<E> implements Iterator<E> {
|
||||
|
||||
|
|
|
@ -33,10 +33,8 @@ import org.apache.commons.collections.ResettableListIterator;
|
|||
* index in the list, thus it starts high and reduces as the iteration
|
||||
* continues. The previous methods work similarly.
|
||||
*
|
||||
* @author Serge Knystautas
|
||||
* @author Stephen Colebourne
|
||||
* @since 3.2
|
||||
* @version $Revision$
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ReverseListIterator<E> implements ResettableListIterator<E> {
|
||||
|
||||
|
|
|
@ -26,11 +26,7 @@ import org.apache.commons.collections.ResettableIterator;
|
|||
* object instance.
|
||||
*
|
||||
* @since 2.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author James Strachan
|
||||
* @author Stephen Colebourne
|
||||
* @author Rodney Waldhoff
|
||||
* @version $Id$
|
||||
*/
|
||||
public class SingletonIterator<E>
|
||||
implements Iterator<E>, ResettableIterator<E> {
|
||||
|
|
|
@ -26,10 +26,7 @@ import org.apache.commons.collections.ResettableListIterator;
|
|||
* object instance.
|
||||
*
|
||||
* @since 2.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Rodney Waldhoff
|
||||
* @version $Id$
|
||||
*/
|
||||
public class SingletonListIterator<E> implements ListIterator<E>, ResettableListIterator<E> {
|
||||
|
||||
|
|
|
@ -24,10 +24,7 @@ import org.apache.commons.collections.Transformer;
|
|||
* Decorates an iterator such that each element returned is transformed.
|
||||
*
|
||||
* @since 1.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author James Strachan
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public class TransformIterator<I, O> implements Iterator<O> {
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ import org.apache.commons.collections.functors.UniquePredicate;
|
|||
* and duplicate Objects are skipped.
|
||||
*
|
||||
* @since 2.1
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Morgan Delagrange
|
||||
* @version $Id$
|
||||
*/
|
||||
public class UniqueFilterIterator<E> extends FilterIterator<E> {
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ import org.apache.commons.collections.Unmodifiable;
|
|||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public final class UnmodifiableIterator<E> implements Iterator<E>, Unmodifiable {
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ import org.apache.commons.collections.Unmodifiable;
|
|||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public final class UnmodifiableListIterator<E> implements ListIterator<E>, Unmodifiable {
|
||||
|
||||
|
|
|
@ -25,9 +25,7 @@ import org.apache.commons.collections.Unmodifiable;
|
|||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public final class UnmodifiableMapIterator<K, V> implements MapIterator<K, V>, Unmodifiable {
|
||||
|
||||
|
|
|
@ -25,9 +25,7 @@ import org.apache.commons.collections.Unmodifiable;
|
|||
* Attempts to modify it will result in an UnsupportedOperationException.
|
||||
*
|
||||
* @since 3.0
|
||||
* @version $Revision$
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @version $Id$
|
||||
*/
|
||||
public final class UnmodifiableOrderedMapIterator<K, V> implements OrderedMapIterator<K, V>,
|
||||
Unmodifiable {
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* This package contains implementations of the
|
||||
* {@link java.util.Iterator Iterator} interface.
|
||||
* <p>
|
||||
* You may also consider using
|
||||
* {@link org.apache.commons.collections.IteratorUtils IteratorUtils},
|
||||
* which is a single class that uses static methods to construct instances
|
||||
* of the classes in this package.
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
package org.apache.commons.collections.iterators;
|
|
@ -1,27 +0,0 @@
|
|||
<!-- $Id$ -->
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<body>
|
||||
<p>
|
||||
This package contains implementations of the
|
||||
{@link java.util.Iterator Iterator} interface.
|
||||
<p>
|
||||
You may also consider using
|
||||
{@link org.apache.commons.collections.IteratorUtils IteratorUtils},
|
||||
which is a single class that uses static methods to construct instances
|
||||
of the classes in this package.
|
||||
</body>
|
Loading…
Reference in New Issue