Javadoc changes

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130783 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2002-08-17 11:29:38 +00:00
parent 18c63e1eff
commit cb996e1b98
1 changed files with 31 additions and 24 deletions

View File

@ -1,7 +1,7 @@
/* /*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/SingletonIterator.java,v 1.1 2002/08/15 23:13:51 pjack Exp $ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/SingletonIterator.java,v 1.2 2002/08/17 11:29:38 scolebourne Exp $
* $Revision: 1.1 $ * $Revision: 1.2 $
* $Date: 2002/08/15 23:13:51 $ * $Date: 2002/08/17 11:29:38 $
* *
* ==================================================================== * ====================================================================
* *
@ -62,13 +62,14 @@ package org.apache.commons.collections.iterators;
import java.util.Iterator; import java.util.Iterator;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
/**
/** <p><code>SingletonIterator</code> is an {@link Iterator} over a single * <p><code>SingletonIterator</code> is an {@link Iterator} over a single
* object instance.</p> * object instance.</p>
* *
* @since 2.0 * @since 2.0
* @author <a href="mailto:jstrachan@apache.org">James Strachan</a> * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
* @version $Revision: 1.1 $ * @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @version $Revision: 1.2 $
*/ */
public class SingletonIterator implements Iterator { public class SingletonIterator implements Iterator {
@ -81,11 +82,14 @@ public class SingletonIterator implements Iterator {
* @param object the single object to return from the iterator * @param object the single object to return from the iterator
*/ */
public SingletonIterator(Object object) { public SingletonIterator(Object object) {
super();
this.object = object; 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
*/ */
@ -94,14 +98,16 @@ public class SingletonIterator implements Iterator {
} }
/** /**
* 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 * @return the single object
* @throws NoSuchElementException if the single object has already been * @throws NoSuchElementException if the single object has already
* returned * been returned
*/ */
public Object next() { public Object next() {
if (! first ) { if (!first) {
throw new NoSuchElementException(); throw new NoSuchElementException();
} }
Object answer = object; Object answer = object;
@ -111,11 +117,12 @@ public class SingletonIterator implements Iterator {
} }
/** /**
* Throws {@link UnsupportedOperationException}. * Remove always throws {@link UnsupportedOperationException}.
* *
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */
public void remove() { public void remove() {
throw new UnsupportedOperationException( "remove() is not supported by this iterator" ); throw new UnsupportedOperationException("remove() is not supported by this iterator");
} }
} }