MailboxListpublic class MailboxList extends Object An immutable, random-access list of Mailbox objects. |
Fields Summary |
---|
private ArrayList | mailboxes |
Constructors Summary |
---|
public MailboxList(ArrayList mailboxes, boolean dontCopy)
if (mailboxes != null)
this.mailboxes = (dontCopy ? mailboxes : (ArrayList) mailboxes.clone());
else
this.mailboxes = new ArrayList(0);
|
Methods Summary |
---|
public Mailbox | get(int index)Gets an address.
if (0 > index || size() <= index)
throw new IndexOutOfBoundsException();
return (Mailbox) mailboxes.get(index);
| public void | print()Dumps a representation of this mailbox list to
stdout, for debugging purposes.
for (int i = 0; i < size(); i++) {
Mailbox mailbox = get(i);
System.out.println(mailbox.toString());
}
| public int | size()The number of elements in this list.
return mailboxes.size();
|
|