1 package org.ibex.mail.target;
2 import org.ibex.mail.*;
3 import org.ibex.util.*;
4 import org.ibex.mail.*;
10 public class MessageArrayMailbox extends Mailbox.Default {
12 private final Message[] messages;
14 public MessageArrayMailbox(Message[] messages) { this.messages = messages; }
16 public void add(Message message) { return; }
17 public void add(Message message, int flags) { return; }
18 public int uidNext() { return messages.length+1; }
19 public Mailbox.Iterator iterator() { return new MessageArrayMailbox.Iterator(); }
21 public class Iterator extends Mailbox.Default.Iterator {
22 private int position = -1;
24 public Message cur() { return messages[position]; }
25 public MIME.Headers head() { return messages[position].headers; }
26 public boolean next() { return ++position < messages.length; }
27 public int uid() { return position+1; }
28 public int num() { return position+1; }
29 public void delete() { return; }
31 public void set(String key, String val) { return; }
32 public String get(String key) { return null; }
34 public boolean seen() { return false; }
35 public boolean deleted() { return false; }
36 public boolean flagged() { return false; }
37 public boolean draft() { return false; }
38 public boolean answered() { return false; }
39 public boolean recent() { return true; }
41 public void seen(boolean on) { return; }
42 public void deleted(boolean on) { return; }
43 public void flagged(boolean on) { return; }
44 public void draft(boolean on) { return; }
45 public void answered(boolean on) { return; }
46 public void recent(boolean on) { return; }