/[classpath]/inetlib/source/gnu/inet/nntp/ArticleNumberIterator.java
ViewVC logotype

Diff of /inetlib/source/gnu/inet/nntp/ArticleNumberIterator.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dog, Sun Oct 19 08:51:37 2003 UTC revision 1.2 by dog, Sun Oct 19 16:16:50 2003 UTC
# Line 36  import java.util.NoSuchElementException; Line 36  import java.util.NoSuchElementException;
36   * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>   * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
37   * @version $Revision$ $Date$   * @version $Revision$ $Date$
38   */   */
39  public class ArticleNumberIterator  public class ArticleNumberIterator extends LineIterator
   extends LineIterator  
40  {  {
41    
42    ArticleNumberIterator(NNTPConnection connection)    ArticleNumberIterator(NNTPConnection connection)
# Line 47  public class ArticleNumberIterator Line 46  public class ArticleNumberIterator
46    
47    /**    /**
48     * Returns the next article number.     * Returns the next article number.
49     */       */
50    public Object next()    public Object next()
51    {    {
52      try      try
53      {      {
54        return new Integer(nextArticleNumber());        return new Integer(nextArticleNumber());
55      }      }
56      catch (IOException e)      catch(IOException e)
57      {      {
58        throw new NoSuchElementException("I/O error: "+e.getMessage());        throw new NoSuchElementException("I/O error: " + e.getMessage());
59      }      }
60    }    }
61    
62    /**    /**
63     * Returns the next article number.     * Returns the next article number.
64     */     */
65    public int nextArticleNumber()    public int nextArticleNumber() throws IOException
     throws IOException  
66    {    {
67      String line = nextLine();      String line = nextLine();
68      return Integer.parseInt(line.trim());        return Integer.parseInt(line.trim());
69    }    }
70    
71  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26