FileDocCategorySizeDatePackage
MailboxList.javaAPI DocAndroid 1.5 API2402Wed May 06 22:42:46 BST 2009org.apache.james.mime4j.field.address

MailboxList

public 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)

param
mailboxes An ArrayList that contains only Mailbox objects.
param
dontCopy true iff it is not possible for the mailboxes ArrayList to be modified by someone else.

		if (mailboxes != null)
			this.mailboxes = (dontCopy ? mailboxes : (ArrayList) mailboxes.clone());
		else
			this.mailboxes = new ArrayList(0);
	
Methods Summary
public Mailboxget(int index)
Gets an address.

		if (0 > index || size() <= index)
			throw new IndexOutOfBoundsException();
		return (Mailbox) mailboxes.get(index);
	
public voidprint()
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 intsize()
The number of elements in this list.

		return mailboxes.size();