1 36 package org.columba.ristretto.message; 37 38 45 public class MailboxInfo { 46 47 private String [] definedFlags; 48 private int exists; 49 private int recent; 50 private int unseen; 51 52 private int firstUnseen; 53 private String [] permanentFlags; 54 55 private int uidNext; 56 private int uidValidity; 57 58 private boolean writeAccess; 59 60 63 public MailboxInfo() { 64 exists = recent = unseen = firstUnseen = 0; 65 uidNext = uidValidity = -1; 66 } 67 68 72 public void reset() { 73 exists = recent = unseen = firstUnseen = 0; 74 uidNext = uidValidity = -1; 75 } 76 77 80 public String [] getDefinedFlags() { 81 return (String []) definedFlags.clone(); 82 } 83 86 public void setDefinedFlags(String [] definedFlags) { 87 this.definedFlags = definedFlags; 88 } 89 92 public int getExists() { 93 return exists; 94 } 95 98 public void setExists(int exists) { 99 this.exists = exists; 100 } 101 104 public int getFirstUnseen() { 105 return firstUnseen; 106 } 107 110 public void setFirstUnseen(int firstUnseen) { 111 this.firstUnseen = firstUnseen; 112 } 113 116 public String [] getPermanentFlags() { 117 return (String []) permanentFlags.clone(); 118 } 119 122 public void setPermanentFlags(String [] permanentFlags) { 123 this.permanentFlags = permanentFlags; 124 } 125 128 public int getRecent() { 129 return recent; 130 } 131 134 public void setRecent(int recent) { 135 this.recent = recent; 136 } 137 140 public int getUidNext() { 141 return uidNext; 142 } 143 146 public void setUidNext(int uidNext) { 147 this.uidNext = uidNext; 148 } 149 152 public int getUidValidity() { 153 return uidValidity; 154 } 155 158 public void setUidValidity(int uidValidity) { 159 this.uidValidity = uidValidity; 160 } 161 164 public boolean isWriteAccess() { 165 return writeAccess; 166 } 167 170 public void setWriteAccess(boolean writeAccess) { 171 this.writeAccess = writeAccess; 172 } 173 174 177 public int predictNextUid() { 178 return uidNext++; 179 } 180 181 184 public void incExists() { 185 exists++; 186 } 187 188 191 public void incUnseen() { 192 unseen++; 193 } 194 195 198 public void incRecent() { 199 recent ++; 200 } 201 202 205 public void decExists() { 206 exists--; 207 } 208 209 212 public void decUnseen() { 213 unseen--; 214 } 215 216 219 public void decRecent() { 220 recent--; 221 } 222 225 public int getUnseen() { 226 return unseen; 227 } 228 231 public void setUnseen(int unseen) { 232 this.unseen = unseen; 233 } 234 235 242 public boolean equals(Object obj) { 243 if( !(obj instanceof MailboxInfo) ) return false; 244 245 MailboxInfo other = (MailboxInfo) obj; 246 247 return exists == other.exists && recent == other.recent && unseen == other.unseen; 248 } 249 } 250 | Popular Tags |