View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.net.pop3;
19  
20  /***
21   * POP3MessageInfo is used to return information about messages stored on
22   * a POP3 server.  Its fields are used to mean slightly different things
23   * depending on the information being returned.
24   * <p>
25   * In response to a status command, <code> number </code>
26   * contains the number of messages in the mailbox, <code> size </code>
27   * contains the size of the mailbox in bytes, and <code> identifier </code>
28   * is null.
29   * <p>
30   * In response to a message listings, <code> number </code>
31   * contains the message number, <code> size </code> contains the
32   * size of the message in bytes, and <code> identifier </code> is null.
33   * <p>
34   * In response to unique identifier listings, <code> number </code> contains
35   * the message number, <code> size </code> is undefined, and
36   * <code> identifier </code> contains the message's unique identifier.
37   * <p>
38   * <p>
39   * @author Daniel F. Savarese
40   ***/
41  
42  public final class POP3MessageInfo
43  {
44      public int number;
45      public int size;
46      public String identifier;
47  
48      /***
49       * Creates a POP3MessageInfo instance with <code>number</code> and
50       * <code> size </code> set to 0, and <code>identifier</code> set to
51       * null.
52       ***/
53      public POP3MessageInfo()
54      {
55          number = size = 0;
56          identifier = null;
57      }
58  
59      /***
60       * Creates a POP3MessageInfo instance with <code>number</code> set
61       * to <code> num </code>, <code> size </code> set to <code> octets </code>,
62       * and <code>identifier</code> set to null.
63       ***/
64      public POP3MessageInfo(int num, int octets)
65      {
66          number = num;
67          size = octets;
68          identifier = null;
69      }
70  
71      /***
72       * Creates a POP3MessageInfo instance with <code>number</code> set
73       * to <code> num </code>, <code> size </code> undefined,
74       * and <code>identifier</code> set to <code>uid</code>.
75       ***/
76      public POP3MessageInfo(int num, String uid)
77      {
78          number = num;
79          size = -1;
80          identifier = uid;
81      }
82  }