001 /*
002 * Copyright 2001-2005 The Apache Software Foundation
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.apache.commons.net.pop3;
017
018 /***
019 * POP3MessageInfo is used to return information about messages stored on
020 * a POP3 server. Its fields are used to mean slightly different things
021 * depending on the information being returned.
022 * <p>
023 * In response to a status command, <code> number </code>
024 * contains the number of messages in the mailbox, <code> size </code>
025 * contains the size of the mailbox in bytes, and <code> identifier </code>
026 * is null.
027 * <p>
028 * In response to a message listings, <code> number </code>
029 * contains the message number, <code> size </code> contains the
030 * size of the message in bytes, and <code> identifier </code> is null.
031 * <p>
032 * In response to unique identifier listings, <code> number </code> contains
033 * the message number, <code> size </code> is undefined, and
034 * <code> identifier </code> contains the message's unique identifier.
035 * <p>
036 * <p>
037 * @author Daniel F. Savarese
038 ***/
039
040 public final class POP3MessageInfo
041 {
042 public int number;
043 public int size;
044 public String identifier;
045
046 /***
047 * Creates a POP3MessageInfo instance with <code>number</code> and
048 * <code> size </code> set to 0, and <code>identifier</code> set to
049 * null.
050 ***/
051 public POP3MessageInfo()
052 {
053 number = size = 0;
054 identifier = null;
055 }
056
057 /***
058 * Creates a POP3MessageInfo instance with <code>number</code> set
059 * to <code> num </code>, <code> size </code> set to <code> octets </code>,
060 * and <code>identifier</code> set to null.
061 ***/
062 public POP3MessageInfo(int num, int octets)
063 {
064 number = num;
065 size = octets;
066 identifier = null;
067 }
068
069 /***
070 * Creates a POP3MessageInfo instance with <code>number</code> set
071 * to <code> num </code>, <code> size </code> undefined,
072 * and <code>identifier</code> set to <code>uid</code>.
073 ***/
074 public POP3MessageInfo(int num, String uid)
075 {
076 number = num;
077 size = -1;
078 identifier = uid;
079 }
080 }