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