commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/iterators AbstractEmptyIterator.java EmptyIterator.java EmptyListIterator.java
Date Sat, 22 May 2004 11:15:22 GMT
scolebourne    2004/05/22 04:15:22

  Added:       collections/src/java/org/apache/commons/collections/iterators
                        Tag: COLLECTIONS_2_1_BRANCH
                        AbstractEmptyIterator.java EmptyIterator.java
                        EmptyListIterator.java
  Log:
  Add EmptyIterator to solve binary incompatibility on IteratorUtils
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.1   +3 -19     jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/AbstractEmptyIterator.java
  
  Index: AbstractEmptyIterator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/AbstractEmptyIterator.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- AbstractEmptyIterator.java	22 May 2004 09:46:39 -0000	1.1
  +++ AbstractEmptyIterator.java	22 May 2004 11:15:22 -0000	1.1.2.1
  @@ -20,12 +20,12 @@
   /** 
    * Provides an implementation of an empty iterator.
    *
  - * @since Commons Collections 3.1
  + * @since Commons Collections 2.1.1 and 3.0.1
    * @version $Revision$ $Date$
    * 
    * @author Stephen Colebourne
    */
  -public abstract class AbstractEmptyIterator {
  +abstract class AbstractEmptyIterator {
    
       /**
        * Constructor.
  @@ -68,22 +68,6 @@
   
       public void remove() {
           throw new IllegalStateException("Iterator contains no elements");
  -    }
  -
  -    public Object getKey() {
  -        throw new IllegalStateException("Iterator contains no elements");
  -    }
  -
  -    public Object getValue() {
  -        throw new IllegalStateException("Iterator contains no elements");
  -    }
  -
  -    public Object setValue(Object value) {
  -        throw new IllegalStateException("Iterator contains no elements");
  -    }
  -
  -    public void reset() {
  -        // do nothing
       }
   
   }
  
  
  
  1.1.2.1   +6 -13     jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/EmptyIterator.java
  
  Index: EmptyIterator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/EmptyIterator.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- EmptyIterator.java	22 May 2004 09:46:39 -0000	1.1
  +++ EmptyIterator.java	22 May 2004 11:15:22 -0000	1.1.2.1
  @@ -17,32 +17,25 @@
   
   import java.util.Iterator;
   
  -import org.apache.commons.collections.ResettableIterator;
  -
   /** 
    * Provides an implementation of an empty iterator.
    * <p>
    * This class provides an implementation of an empty iterator.
    * This class provides for binary compatability between Commons Collections
  - * 2.1.1 and 3.1 due to issues with <code>IteratorUtils</code>.
  + * 2.1.1 and 3.0.1 due to issues with <code>IteratorUtils</code>.
    *
  - * @since Commons Collections 2.1.1 and 3.1
  + * @since Commons Collections 2.1.1 and 3.0.1
    * @version $Revision$ $Date$
    * 
    * @author Stephen Colebourne
    */
  -public class EmptyIterator extends AbstractEmptyIterator implements ResettableIterator
{
  +public final class EmptyIterator extends AbstractEmptyIterator implements Iterator {
   
       /**
        * Singleton instance of the iterator.
  -     * @since Commons Collections 3.1
  -     */
  -    public static final ResettableIterator RESETTABLE_INSTANCE = new EmptyIterator();
  -    /**
  -     * Singleton instance of the iterator.
  -     * @since Commons Collections 2.1.1 and 3.1
  +     * @since Commons Collections 2.1.1 and 3.0.1
        */
  -    public static final Iterator INSTANCE = RESETTABLE_INSTANCE;
  +    public static final Iterator INSTANCE = new EmptyIterator();
   
       /**
        * Constructor.
  
  
  
  1.1.2.1   +6 -19     jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/EmptyListIterator.java
  
  Index: EmptyListIterator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/EmptyListIterator.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- EmptyListIterator.java	22 May 2004 09:46:39 -0000	1.1
  +++ EmptyListIterator.java	22 May 2004 11:15:22 -0000	1.1.2.1
  @@ -17,38 +17,25 @@
   
   import java.util.ListIterator;
   
  -import org.apache.commons.collections.OrderedIterator;
  -import org.apache.commons.collections.ResettableListIterator;
  -
   /** 
    * Provides an implementation of an empty list iterator.
    * <p>
    * This class provides an implementation of an empty list iterator.
    * This class provides for binary compatability between Commons Collections
  - * 2.1.1 and 3.1 due to issues with <code>IteratorUtils</code>.
  + * 2.1.1 and 3.0.1 due to issues with <code>IteratorUtils</code>.
    *
  - * @since Commons Collections 2.1.1 and 3.1
  + * @since Commons Collections 2.1.1 and 3.0.1
    * @version $Revision$ $Date$
    * 
    * @author Stephen Colebourne
    */
  -public class EmptyListIterator extends AbstractEmptyIterator implements ResettableListIterator,
OrderedIterator {
  +public final class EmptyListIterator extends AbstractEmptyIterator implements ListIterator
{
   
       /**
        * Singleton instance of the iterator.
  -     * @since Commons Collections 3.1
  -     */
  -    public static final ResettableListIterator RESETTABLE_INSTANCE = new EmptyListIterator();
  -    /**
  -     * Singleton instance of the iterator.
  -     * @since Commons Collections 2.1.1 and 3.1
  -     */
  -    public static final ListIterator INSTANCE = RESETTABLE_INSTANCE;
  -    /**
  -     * Singleton instance of the iterator.
  -     * @since Commons Collections 3.1
  +     * @since Commons Collections 2.1.1 and 3.0.1
        */
  -    public static final OrderedIterator ORDERED_INSTANCE = (OrderedIterator) RESETTABLE_INSTANCE;
  +    public static final ListIterator INSTANCE = new EmptyListIterator();
   
       /**
        * Constructor.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message