1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the Apache Public Source License 2.0 ("the License").
3 // You may not use this file except in compliance with the License.
5 package org.ibex.mail.target;
6 import org.ibex.mail.*;
7 import org.ibex.util.*;
8 import org.ibex.mail.*;
14 public class MessageArrayMailbox extends Mailbox.Default {
16 private final Message[] messages;
18 public MessageArrayMailbox(Message[] messages) { this.messages = messages; }
20 public void add(Message message) { return; }
21 public void add(Message message, int flags) { return; }
22 public int uidNext() { return messages.length+1; }
23 public Mailbox.Iterator iterator() { return new MessageArrayMailbox.Iterator(); }
25 public class Iterator extends Mailbox.Default.Iterator {
26 private int position = -1;
28 public Message cur() { return messages[position]; }
29 public Headers head() { return messages[position].headers; }
30 public boolean next() { return ++position < messages.length; }
31 public int uid() { return position+1; }
32 public int num() { return position+1; }
33 public void delete() { return; }
35 public void set(String key, String val) { return; }
36 public String get(String key) { return null; }
38 public boolean seen() { return false; }
39 public boolean deleted() { return false; }
40 public boolean flagged() { return false; }
41 public boolean draft() { return false; }
42 public boolean answered() { return false; }
43 public boolean recent() { return true; }
45 public void seen(boolean on) { return; }
46 public void deleted(boolean on) { return; }
47 public void flagged(boolean on) { return; }
48 public void draft(boolean on) { return; }
49 public void answered(boolean on) { return; }
50 public void recent(boolean on) { return; }