1 36 package org.columba.ristretto.imap; 37 38 import java.io.IOException ; 39 import java.io.ObjectInputStream ; 40 41 import org.columba.ristretto.message.Flags; 42 43 51 public class IMAPFlags extends Flags { 52 53 57 public static final short JUNK = 0x0100; 58 59 private Object uid; 60 private int index; 61 62 63 67 public IMAPFlags() { 68 super(); 69 } 70 71 76 public IMAPFlags(short flags) { 77 super(flags); 78 } 79 80 86 public IMAPFlags(ObjectInputStream in) throws IOException { 87 super(in); 88 } 89 90 95 public Object getUid() { 96 return uid; 97 } 98 99 104 public void setUid(Object object) { 105 uid = object; 106 } 107 108 109 114 public void setJunk(boolean b) { 115 set(JUNK,b); 116 } 117 118 123 public boolean getJunk() { 124 return get(JUNK); 125 } 126 127 128 131 public String toString() { 132 boolean first = true; 133 StringBuffer result = new StringBuffer ("("); 134 135 if( getAnswered()) { 136 result.append("\\Answered"); 137 first = false; 138 } 139 140 if( getFlagged()) { 141 if( !first ) result.append(" "); 142 first = false; 143 result.append("\\Flagged"); 144 } 145 146 if( getDeleted()) { 147 if( !first ) result.append(" "); 148 first = false; 149 result.append("\\Deleted"); 150 } 151 152 if( getSeen()) { 153 if( !first ) result.append(" "); 154 first = false; 155 result.append("\\Seen"); 156 } 157 158 if( getDraft()) { 159 if( !first ) result.append(" "); 160 first = false; 161 result.append("\\Draft"); 162 } 163 164 169 170 if( this.get(JUNK)) { 172 if( !first ) result.append(" "); 173 first = false; 174 result.append("JUNK"); 175 } 176 177 result.append(")"); 178 179 return result.toString(); 180 181 } 182 185 public int getIndex() { 186 return index; 187 } 188 191 public void setIndex(int index) { 192 this.index = index; 193 } 194 } 195 | Popular Tags |