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.
6 import org.ibex.util.*;
7 import org.ibex.mail.*;
13 public class MessageArrayMailbox extends Mailbox.Default {
15 private final Message[] messages;
17 public MessageArrayMailbox(Message[] messages) { this.messages = messages; }
19 public void insert(Message message, int flags) { return; }
20 public int uidNext() { return messages.length+1; }
21 public Mailbox.Iterator iterator() { return new MessageArrayMailbox.Iterator(); }
23 public class Iterator extends Mailbox.Default.Iterator {
24 private int position = -1;
26 public Message cur() { return messages[position]; }
27 public Headers head() { return messages[position].headers; }
28 public boolean next() { return ++position < messages.length; }
29 public int uid() { return position+1; }
30 public int imapNumber() { return position+1; }
31 public void delete() { return; }