home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 25 / CDROM25.iso / Share / prog / VJ11 / VJTRIAL.EXE / IE30Java.exe / classd.exe / sun / net / nntp / NewsgroupInfo.java < prev    next >
Encoding:
Java Source  |  1997-01-27  |  2.1 KB  |  63 lines

  1. /*
  2.  * @(#)NewsgroupInfo.java    1.12 95/08/29 Jonathan Payne, James Gosling
  3.  *
  4.  * Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. package sun.net.nntp;
  21.  
  22. import java.io.*;
  23. import java.util.*;
  24.  
  25. /**
  26.  * This class manages information related to the current status of 
  27.  * newsgroups. 
  28.  * 
  29.  * @version     1.5, 12 Dec 1994
  30.  * @author    Jonathan Payne, James Gosling
  31.  * @see        NntpClient
  32.  */
  33. public class NewsgroupInfo {
  34.     /** This newsgroup's name in network form (eg rec.pets) */
  35.     public String   name;
  36.  
  37.     /** Number of the first and last articles in the group */
  38.     public int        firstArticle;
  39.     public int        lastArticle;
  40.  
  41.     public NewsgroupInfo(String name, int start, int end) {
  42.     this.name = name;
  43.     firstArticle = start;
  44.     lastArticle = end;
  45.     }
  46.  
  47.     /** convert the information to a printable string of the form:
  48.      *  <p>
  49.      *  NewsgroupInfo[name=<i>name</i>[<i>firstArticle</i>,<i>lastArticle</i>]
  50.      */
  51.     public String toString() {
  52.     return "NewsgroupInfo[name=" + name + "[" + firstArticle + ", "
  53.         + lastArticle + "]";
  54.     }
  55.  
  56.     /** Reload news in the group using nntp.getGroup(this.name) */
  57.     public void reload(NntpClient nntp) throws IOException {
  58.     NewsgroupInfo newinfo = nntp.getGroup(name);
  59.     this.firstArticle = newinfo.firstArticle;
  60.     this.lastArticle = newinfo.lastArticle;
  61.     }
  62. }
  63.