/[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.5 by dog, Thu Oct 21 15:21:55 2004 UTC revision 1.6 by dog, Thu Nov 25 22:15:05 2004 UTC
# Line 1  Line 1 
1  /*  /*
2   * $Id$   * ArticleNumberIterator.java
3   * Copyright (C) 2003 The Free Software Foundation   * Copyright (C) 2003 The Free Software Foundation
4   *   *
5   * This file is part of GNU inetlib, a library.   * This file is part of GNU inetlib, a library.
# Line 45  import java.util.NoSuchElementException; Line 45  import java.util.NoSuchElementException;
45   * An iterator over a listing of article numbers.   * An iterator over a listing of article numbers.
46   *   *
47   * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>   * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
  * @version $Revision$ $Date$  
48   */   */
49  public class ArticleNumberIterator extends LineIterator  public class ArticleNumberIterator
50      extends LineIterator
51  {  {
52    
53    ArticleNumberIterator (NNTPConnection connection)    ArticleNumberIterator(NNTPConnection connection)
54    {    {
55      super (connection);      super(connection);
56    }    }
57    
58    /**    /**
59     * Returns the next article number.     * Returns the next article number.
60     */     */
61    public Object next ()    public Object next()
62    {    {
63      try      try
64        {        {
65          return new Integer (nextArticleNumber ());          return new Integer(nextArticleNumber());
66        }        }
67      catch (IOException e)      catch (IOException e)
68        {        {
69          throw new NoSuchElementException ("I/O error: " + e.getMessage ());          throw new NoSuchElementException("I/O error: " + e.getMessage());
70        }        }
71    }    }
72    
73    /**    /**
74     * Returns the next article number.     * Returns the next article number.
75     */     */
76    public int nextArticleNumber () throws IOException    public int nextArticleNumber()
77        throws IOException
78    {    {
79      String line = nextLine ();      String line = nextLine();
80      return Integer.parseInt (line.trim ());      return Integer.parseInt(line.trim());
81    }    }
82    
83  }  }
84    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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