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:
Thomas Neidhart 2012-07-29 09:29:15 +00:00
parent e5f105dab9
commit 922da12f3f
37 changed files with 67 additions and 163 deletions

View File

@ -22,9 +22,7 @@ import java.util.NoSuchElementException;
* Provides an implementation of an empty iterator. * Provides an implementation of an empty iterator.
* *
* @since 3.1 * @since 3.1
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
abstract class AbstractEmptyIterator<E> { abstract class AbstractEmptyIterator<E> {

View File

@ -24,10 +24,7 @@ import java.util.Iterator;
* All methods are forwarded to the decorated iterator. * All methods are forwarded to the decorated iterator.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Stephen Colebourne
*/ */
public abstract class AbstractIteratorDecorator<E> extends AbstractUntypedIteratorDecorator<E, E> { public abstract class AbstractIteratorDecorator<E> extends AbstractUntypedIteratorDecorator<E, E> {

View File

@ -24,10 +24,7 @@ import java.util.ListIterator;
* All methods are forwarded to the decorated list iterator. * All methods are forwarded to the decorated list iterator.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Rodney Waldhoff
* @author Stephen Colebourne
*/ */
public class AbstractListIteratorDecorator<E> implements ListIterator<E> { public class AbstractListIteratorDecorator<E> implements ListIterator<E> {

View File

@ -24,9 +24,7 @@ import org.apache.commons.collections.MapIterator;
* All methods are forwarded to the decorated map iterator. * All methods are forwarded to the decorated map iterator.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class AbstractMapIteratorDecorator<K, V> implements MapIterator<K, V> { public class AbstractMapIteratorDecorator<K, V> implements MapIterator<K, V> {

View File

@ -24,9 +24,7 @@ import org.apache.commons.collections.OrderedMapIterator;
* All methods are forwarded to the decorated map iterator. * All methods are forwarded to the decorated map iterator.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class AbstractOrderedMapIteratorDecorator<K, V> implements OrderedMapIterator<K, V> { public class AbstractOrderedMapIteratorDecorator<K, V> implements OrderedMapIterator<K, V> {

View File

@ -33,13 +33,7 @@ import org.apache.commons.collections.ResettableIterator;
* the iterator back to the start if required. * the iterator back to the start if required.
* *
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Mauricio S. Moura
* @author Michael A. Smith
* @author Neil O'Toole
* @author Stephen Colebourne
*/ */
public class ArrayIterator<E> implements ResettableIterator<E> { public class ArrayIterator<E> implements ResettableIterator<E> {

View File

@ -38,11 +38,7 @@ import org.apache.commons.collections.ResettableListIterator;
* @see java.util.ListIterator * @see java.util.ListIterator
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Neil O'Toole
* @author Stephen Colebourne
* @author Phil Steitz
*/ */
public class ArrayListIterator<E> extends ArrayIterator<E> public class ArrayListIterator<E> extends ArrayIterator<E>
implements ListIterator<E>, ResettableListIterator<E> { implements ListIterator<E>, ResettableListIterator<E> {

View File

@ -36,10 +36,7 @@ import org.apache.commons.collections.list.UnmodifiableList;
* lesser of <code>A.next()</code> and <code>B.next()</code>. * lesser of <code>A.next()</code> and <code>B.next()</code>.
* *
* @since 2.1 * @since 2.1
* @version $Revision$ * @version $Id$
*
* @author Rodney Waldhoff
* @author Stephen Colebourne
*/ */
public class CollatingIterator<E> implements Iterator<E> { public class CollatingIterator<E> implements Iterator<E> {

View File

@ -28,9 +28,7 @@ import org.apache.commons.collections.ResettableIterator;
* 2.1.1 and 3.1 due to issues with <code>IteratorUtils</code>. * 2.1.1 and 3.1 due to issues with <code>IteratorUtils</code>.
* *
* @since 2.1.1 and 3.1 * @since 2.1.1 and 3.1
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class EmptyIterator<E> extends AbstractEmptyIterator<E> implements ResettableIterator<E> { public class EmptyIterator<E> extends AbstractEmptyIterator<E> implements ResettableIterator<E> {

View File

@ -28,9 +28,7 @@ import org.apache.commons.collections.ResettableListIterator;
* due to issues with <code>IteratorUtils</code>. * due to issues with <code>IteratorUtils</code>.
* *
* @since 2.1.1 and 3.1 * @since 2.1.1 and 3.1
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class EmptyListIterator<E> extends AbstractEmptyIterator<E> implements public class EmptyListIterator<E> extends AbstractEmptyIterator<E> implements
ResettableListIterator<E> { ResettableListIterator<E> {

View File

@ -23,9 +23,7 @@ import org.apache.commons.collections.ResettableIterator;
* Provides an implementation of an empty map iterator. * Provides an implementation of an empty map iterator.
* *
* @since 3.1 * @since 3.1
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class EmptyMapIterator<K, V> extends AbstractEmptyMapIterator<K, V> implements public class EmptyMapIterator<K, V> extends AbstractEmptyMapIterator<K, V> implements
MapIterator<K, V>, ResettableIterator<K> { MapIterator<K, V>, ResettableIterator<K> {

View File

@ -23,11 +23,10 @@ import org.apache.commons.collections.ResettableIterator;
* Provides an implementation of an empty ordered iterator. * Provides an implementation of an empty ordered iterator.
* *
* @since 3.1 * @since 3.1
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
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. * Singleton instance of the iterator.

View File

@ -23,12 +23,10 @@ import org.apache.commons.collections.ResettableIterator;
* Provides an implementation of an empty ordered map iterator. * Provides an implementation of an empty ordered map iterator.
* *
* @since 3.1 * @since 3.1
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class EmptyOrderedMapIterator<K, V> extends AbstractEmptyMapIterator<K, V> implements public class EmptyOrderedMapIterator<K, V> extends AbstractEmptyMapIterator<K, V>
OrderedMapIterator<K, V>, ResettableIterator<K> { implements OrderedMapIterator<K, V>, ResettableIterator<K> {
/** /**
* Singleton instance of the iterator. * Singleton instance of the iterator.

View File

@ -35,9 +35,7 @@ import org.apache.commons.collections.ResettableIterator;
* </pre> * </pre>
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class EntrySetMapIterator<K, V> implements MapIterator<K, V>, ResettableIterator<K> { public class EntrySetMapIterator<K, V> implements MapIterator<K, V>, ResettableIterator<K> {

View File

@ -25,10 +25,7 @@ import java.util.Iterator;
* to be {@link Iterator Iterator} instances. * to be {@link Iterator Iterator} instances.
* *
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Id$
*
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
*/ */
public class EnumerationIterator<E> implements Iterator<E> { public class EnumerationIterator<E> implements Iterator<E> {

View File

@ -28,12 +28,7 @@ import org.apache.commons.collections.Predicate;
* those elements that match the specified {@link Predicate Predicate}. * those elements that match the specified {@link Predicate Predicate}.
* *
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Jan Sorensen
* @author Ralph Wagner
* @author Stephen Colebourne
*/ */
public class FilterIterator<E> implements Iterator<E> { public class FilterIterator<E> implements Iterator<E> {

View File

@ -28,9 +28,7 @@ import org.apache.commons.collections.Predicate;
* those elements that match the specified {@link Predicate Predicate}. * those elements that match the specified {@link Predicate Predicate}.
* *
* @since 2.0 * @since 2.0
* @version $Revision$ * @version $Id$
*
* @author Rodney Waldhoff
*/ */
public class FilterListIterator<E> implements ListIterator<E> { public class FilterListIterator<E> implements ListIterator<E> {

View File

@ -44,11 +44,7 @@ import org.apache.commons.collections.list.UnmodifiableList;
* this case the class will function as an empty iterator. * this case the class will function as an empty iterator.
* *
* @since 2.1 * @since 2.1
* @version $Revision$ * @version $Id$
* 2006) $
*
* @author Morgan Delagrange
* @author Stephen Colebourne
*/ */
public class IteratorChain<E> implements Iterator<E> { public class IteratorChain<E> implements Iterator<E> {

View File

@ -24,9 +24,7 @@ import java.util.Iterator;
* {@link Enumeration Enumeration} instance. * {@link Enumeration Enumeration} instance.
* *
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Id$
*
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
*/ */
public class IteratorEnumeration<E> implements Enumeration<E> { public class IteratorEnumeration<E> implements Enumeration<E> {

View File

@ -58,7 +58,7 @@ import org.apache.commons.collections.ResettableIterator;
* </p> * </p>
* *
* @since 4.0 * @since 4.0
* @version $Revision$ * @version $Id$
*/ */
public class IteratorIterable<E> implements Iterable<E> { public class IteratorIterable<E> implements Iterable<E> {

View File

@ -23,7 +23,6 @@ import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import org.apache.commons.collections.ResettableIterator;
import org.apache.commons.collections.ResettableListIterator; 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. * This class implements ResettableListIterator from Commons Collections 3.2.
* *
* @since 2.1 * @since 2.1
* @version $Revision$ * @version $Id$
*
* @author Morgan Delagrange
* @author Stephen Colebourne
* @author Matt Benson
*/ */
public class ListIteratorWrapper<E> implements ResettableListIterator<E> { public class ListIteratorWrapper<E> implements ResettableListIterator<E> {

View File

@ -33,10 +33,7 @@ import org.apache.commons.collections.ResettableIterator;
* implementations will throw a ConcurrentModificationException. * implementations will throw a ConcurrentModificationException.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author <a href="mailto:joncrlsn@users.sf.net">Jonathan Carlson</a>
* @author Stephen Colebourne
*/ */
public class LoopingIterator<E> implements ResettableIterator<E> { public class LoopingIterator<E> implements ResettableIterator<E> {

View File

@ -35,9 +35,7 @@ import org.apache.commons.collections.ResettableListIterator;
* ConcurrentModificationException. * ConcurrentModificationException.
* *
* @since 3.2 * @since 3.2
* @version $Revision$ * @version $Id$
*
* @author Eric Crampton <ccesc@eonomine.com>
*/ */
public class LoopingListIterator<E> implements ResettableListIterator<E> { public class LoopingListIterator<E> implements ResettableListIterator<E> {

View File

@ -31,14 +31,7 @@ import org.apache.commons.collections.ResettableIterator;
* back to the start if required. * back to the start if required.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Mauricio S. Moura
* @author Michael A. Smith
* @author Neil O'Toole
* @author Stephen Colebourne
* @author Phil Steitz
*/ */
public class ObjectArrayIterator<E> public class ObjectArrayIterator<E>
implements Iterator<E>, ResettableIterator<E> { implements Iterator<E>, ResettableIterator<E> {

View File

@ -35,11 +35,7 @@ import org.apache.commons.collections.ResettableListIterator;
* @see java.util.ListIterator * @see java.util.ListIterator
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Neil O'Toole
* @author Stephen Colebourne
* @author Phil Steitz
*/ */
public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E> public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
implements ListIterator<E>, ResettableListIterator<E> { implements ListIterator<E>, ResettableListIterator<E> {

View File

@ -71,9 +71,7 @@ import org.apache.commons.collections.Transformer;
* more efficient (and convenient) than using nested for loops to extract a list. * more efficient (and convenient) than using nested for loops to extract a list.
* *
* @since 3.1 * @since 3.1
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class ObjectGraphIterator<E> implements Iterator<E> { public class ObjectGraphIterator<E> implements Iterator<E> {

View File

@ -33,10 +33,8 @@ import org.apache.commons.collections.ResettableListIterator;
* index in the list, thus it starts high and reduces as the iteration * index in the list, thus it starts high and reduces as the iteration
* continues. The previous methods work similarly. * continues. The previous methods work similarly.
* *
* @author Serge Knystautas
* @author Stephen Colebourne
* @since 3.2 * @since 3.2
* @version $Revision$ * @version $Id$
*/ */
public class ReverseListIterator<E> implements ResettableListIterator<E> { public class ReverseListIterator<E> implements ResettableListIterator<E> {

View File

@ -26,11 +26,7 @@ import org.apache.commons.collections.ResettableIterator;
* object instance. * object instance.
* *
* @since 2.0 * @since 2.0
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Stephen Colebourne
* @author Rodney Waldhoff
*/ */
public class SingletonIterator<E> public class SingletonIterator<E>
implements Iterator<E>, ResettableIterator<E> { implements Iterator<E>, ResettableIterator<E> {

View File

@ -26,10 +26,7 @@ import org.apache.commons.collections.ResettableListIterator;
* object instance. * object instance.
* *
* @since 2.1 * @since 2.1
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
* @author Rodney Waldhoff
*/ */
public class SingletonListIterator<E> implements ListIterator<E>, ResettableListIterator<E> { public class SingletonListIterator<E> implements ListIterator<E>, ResettableListIterator<E> {

View File

@ -24,10 +24,7 @@ import org.apache.commons.collections.Transformer;
* Decorates an iterator such that each element returned is transformed. * Decorates an iterator such that each element returned is transformed.
* *
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Stephen Colebourne
*/ */
public class TransformIterator<I, O> implements Iterator<O> { public class TransformIterator<I, O> implements Iterator<O> {

View File

@ -26,9 +26,7 @@ import org.apache.commons.collections.functors.UniquePredicate;
* and duplicate Objects are skipped. * and duplicate Objects are skipped.
* *
* @since 2.1 * @since 2.1
* @version $Revision$ * @version $Id$
*
* @author Morgan Delagrange
*/ */
public class UniqueFilterIterator<E> extends FilterIterator<E> { public class UniqueFilterIterator<E> extends FilterIterator<E> {

View File

@ -26,9 +26,7 @@ import org.apache.commons.collections.Unmodifiable;
* Attempts to modify it will result in an UnsupportedOperationException. * Attempts to modify it will result in an UnsupportedOperationException.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public final class UnmodifiableIterator<E> implements Iterator<E>, Unmodifiable { public final class UnmodifiableIterator<E> implements Iterator<E>, Unmodifiable {

View File

@ -26,9 +26,7 @@ import org.apache.commons.collections.Unmodifiable;
* Attempts to modify it will result in an UnsupportedOperationException. * Attempts to modify it will result in an UnsupportedOperationException.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public final class UnmodifiableListIterator<E> implements ListIterator<E>, Unmodifiable { public final class UnmodifiableListIterator<E> implements ListIterator<E>, Unmodifiable {

View File

@ -25,9 +25,7 @@ import org.apache.commons.collections.Unmodifiable;
* Attempts to modify it will result in an UnsupportedOperationException. * Attempts to modify it will result in an UnsupportedOperationException.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public final class UnmodifiableMapIterator<K, V> implements MapIterator<K, V>, Unmodifiable { public final class UnmodifiableMapIterator<K, V> implements MapIterator<K, V>, Unmodifiable {

View File

@ -25,9 +25,7 @@ import org.apache.commons.collections.Unmodifiable;
* Attempts to modify it will result in an UnsupportedOperationException. * Attempts to modify it will result in an UnsupportedOperationException.
* *
* @since 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public final class UnmodifiableOrderedMapIterator<K, V> implements OrderedMapIterator<K, V>, public final class UnmodifiableOrderedMapIterator<K, V> implements OrderedMapIterator<K, V>,
Unmodifiable { Unmodifiable {

View File

@ -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;

View File

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