1. /*
  2. * Copyright 2001-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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. * POP3MessageInfo is used to return information about messages stored on
  19. * a POP3 server. Its fields are used to mean slightly different things
  20. * depending on the information being returned.
  21. * <p>
  22. * In response to a status command, <code> number </code>
  23. * contains the number of messages in the mailbox, <code> size </code>
  24. * contains the size of the mailbox in bytes, and <code> identifier </code>
  25. * is null.
  26. * <p>
  27. * In response to a message listings, <code> number </code>
  28. * contains the message number, <code> size </code> contains the
  29. * size of the message in bytes, and <code> identifier </code> is null.
  30. * <p>
  31. * In response to unique identifier listings, <code> number </code> contains
  32. * the message number, <code> size </code> is undefined, and
  33. * <code> identifier </code> contains the message's unique identifier.
  34. * <p>
  35. * <p>
  36. * @author Daniel F. Savarese
  37. ***/
  38. public final class POP3MessageInfo
  39. {
  40. public int number;
  41. public int size;
  42. public String identifier;
  43. /***
  44. * Creates a POP3MessageInfo instance with <code>number</code> and
  45. * <code> size </code> set to 0, and <code>identifier</code> set to
  46. * null.
  47. ***/
  48. public POP3MessageInfo()
  49. {
  50. number = size = 0;
  51. identifier = null;
  52. }
  53. /***
  54. * Creates a POP3MessageInfo instance with <code>number</code> set
  55. * to <code> num </code>, <code> size </code> set to <code> octets </code>,
  56. * and <code>identifier</code> set to null.
  57. ***/
  58. public POP3MessageInfo(int num, int octets)
  59. {
  60. number = num;
  61. size = octets;
  62. identifier = null;
  63. }
  64. /***
  65. * Creates a POP3MessageInfo instance with <code>number</code> set
  66. * to <code> num </code>, <code> size </code> undefined,
  67. * and <code>identifier</code> set to <code>uid</code>.
  68. ***/
  69. public POP3MessageInfo(int num, String uid)
  70. {
  71. number = num;
  72. size = -1;
  73. identifier = uid;
  74. }
  75. }