Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/mrbook/mrpostman/another/summary/SummaryItem.java


1   /*
2    * -*- mode: java; c-basic-indent: 4; indent-tabs-mode: nil -*-
3    * :indentSize=4:noTabs=true:tabSize=4:indentOnTab=true:indentOnEnter=true:mode=java:
4    * ex: set tabstop=4 expandtab:
5    *
6    * MrPostman - webmail <-> email gateway
7    * Copyright (C) 2002-2003 MrPostman Development Group
8    * Projectpage: http://mrbook.org/mrpostman/
9    *
10   *
11   * This program is free software; you can redistribute it and/or modify
12   * it under the terms of the GNU General Public License as published by
13   * the Free Software Foundation; either version 2 of the License, or
14   * (at your option) any later version.
15   *
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * In particular, this implies that users are responsible for
21   * using MrPostman after reading the terms and conditions given
22   * by their web-mail provider.
23   *
24   * You should have received a copy of the GNU General Public License
25   * Named LICENSE in the base directory of this distribution,
26   * if not, write to the Free Software
27   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28   */
29  
30  package org.mrbook.mrpostman.another.summary;
31  
32  
33  /**
34  * Represents the summary info for a particular message.
35  * @author Chris Humphreys
36  */
37  public class SummaryItem {
38      public static final String CVSID = "$Id: SummaryItem.java,v 1.5 2003/02/09 23:38:13 lbruand Exp $";
39  
40      /**
41      * The message's header.
42      */
43      private HeaderInfo header;
44  
45      /**
46      * A TOP command summary
47      */
48      private CmdSummary top = new CmdSummary(CmdSummary.TOP);
49  
50      /**
51      * A RETR command summary
52      */
53      private CmdSummary retr = new CmdSummary(CmdSummary.RETR);
54  
55      /**
56      * A DELE command summary
57      */
58      private CmdSummary dele = new CmdSummary(CmdSummary.DELE);
59  
60      /**
61      * Return a string prepresentation of this summary information
62      */
63      public String toString() {
64          StringBuffer buff = new StringBuffer();
65          String linefeed = System.getProperty("line.separator");
66          buff.append(header).append(linefeed);
67          buff.append(top).append(linefeed);
68          buff.append(retr).append(linefeed);
69          buff.append(dele).append(linefeed);
70          return buff.toString();
71      }
72  
73      public void setHeader(HeaderInfo newHeader) {
74          header = newHeader;
75      }
76  
77      public HeaderInfo getHeader() {
78          return header;
79      }
80  
81      public CmdSummary getTop() {
82          return top;
83      }
84  
85      public CmdSummary getRetr() {
86          return retr;
87      }
88  
89      public CmdSummary getDele() {
90          return dele;
91      }
92  }