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 SingletonIterator.java
Date Sat, 17 Aug 2002 11:29:38 GMT
scolebourne    2002/08/17 04:29:38

  Modified:    collections/src/java/org/apache/commons/collections/iterators
                        SingletonIterator.java
  Log:
  Javadoc changes
  
  Revision  Changes    Path
  1.2       +31 -24    jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/SingletonIterator.java
  
  Index: SingletonIterator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/iterators/SingletonIterator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SingletonIterator.java	15 Aug 2002 23:13:51 -0000	1.1
  +++ SingletonIterator.java	17 Aug 2002 11:29:38 -0000	1.2
  @@ -62,46 +62,52 @@
   
   import java.util.Iterator;
   import java.util.NoSuchElementException;
  -
  -/** <p><code>SingletonIterator</code> is an {@link Iterator} over a single

  -  * object instance.</p>
  -  *
  -  * @since 2.0
  -  * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision$
  -  */
  +/** 
  + * <p><code>SingletonIterator</code> is an {@link Iterator} over a single

  + * object instance.</p>
  + *
  + * @since 2.0
  + * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  + * @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
  + * @version $Revision$
  + */
   public class SingletonIterator implements Iterator {
   
       private boolean first = true;
       private Object object;
  -    
  +
       /**
  -     *  Constructs a new <Code>SingletonIterator</Code>.
  +     * Constructs a new <Code>SingletonIterator</Code>.
        *
  -     *  @param object  the single object to return from the iterator
  +     * @param object  the single object to return from the iterator
        */
       public SingletonIterator(Object object) {
  +        super();
           this.object = object;
       }
   
       /**
  -     *  Returns true if the single object hasn't been returned yet.
  +     * Is another object available from the iterator.
  +     * <p>
  +     * This returns true if the single object hasn't been returned yet.
        * 
  -     *  @return true if the single object hasn't been returned yet
  +     * @return true if the single object hasn't been returned yet
        */
       public boolean hasNext() {
           return first;
       }
   
       /**
  -     *  Returns the single object if it hasn't been returned yet.
  +     * Get the next object from the iterator.
  +     * <p>
  +     * This returns the single object if it hasn't been returned yet.
        *
  -     *  @return the single object
  -     *  @throws NoSuchElementException if the single object has already been
  -     *    returned
  +     * @return the single object
  +     * @throws NoSuchElementException if the single object has already 
  +     *    been returned
        */
       public Object next() {
  -        if (! first ) {
  +        if (!first) {
               throw new NoSuchElementException();
           }
           Object answer = object;
  @@ -111,11 +117,12 @@
       }
   
       /**
  -     *  Throws {@link UnsupportedOperationException}.
  +     * Remove always throws {@link UnsupportedOperationException}.
        *
  -     *  @throws UnsupportedOperationException always
  +     * @throws UnsupportedOperationException always
        */
       public void remove() {
  -        throw new UnsupportedOperationException( "remove() is not supported by this iterator"
);
  +        throw new UnsupportedOperationException("remove() is not supported by this iterator");
       }
  +    
   }
  
  
  

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


Mime
View raw message