Return a string representation of this Flags object. Note that the exact format of the string is subject to change.
()
| 497 | * Note that the exact format of the string is subject to change. |
| 498 | */ |
| 499 | public String toString() { |
| 500 | StringBuilder sb = new StringBuilder(); |
| 501 | |
| 502 | if ((system_flags & ANSWERED_BIT) != 0) |
| 503 | sb.append("\\Answered "); |
| 504 | if ((system_flags & DELETED_BIT) != 0) |
| 505 | sb.append("\\Deleted "); |
| 506 | if ((system_flags & DRAFT_BIT) != 0) |
| 507 | sb.append("\\Draft "); |
| 508 | if ((system_flags & FLAGGED_BIT) != 0) |
| 509 | sb.append("\\Flagged "); |
| 510 | if ((system_flags & RECENT_BIT) != 0) |
| 511 | sb.append("\\Recent "); |
| 512 | if ((system_flags & SEEN_BIT) != 0) |
| 513 | sb.append("\\Seen "); |
| 514 | if ((system_flags & USER_BIT) != 0) |
| 515 | sb.append("\\* "); |
| 516 | |
| 517 | boolean first = true; |
| 518 | if (user_flags != null) { |
| 519 | Enumeration<String> e = user_flags.elements(); |
| 520 | |
| 521 | while (e.hasMoreElements()) { |
| 522 | if (first) |
| 523 | first = false; |
| 524 | else |
| 525 | sb.append(' '); |
| 526 | sb.append(e.nextElement()); |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | if (first && sb.length() > 0) |
| 531 | sb.setLength(sb.length() - 1); // smash trailing space |
| 532 | |
| 533 | return sb.toString(); |
| 534 | } |
| 535 | |
| 536 | /***** |
| 537 | public static void main(String argv[]) throws Exception { |
no test coverage detected