org.apache.james.mime4j.field.address
Class AddressList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<Address>
          extended by org.apache.james.mime4j.field.address.AddressList
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<Address>, java.util.Collection<Address>, java.util.List<Address>

public class AddressList
extends java.util.AbstractList<Address>
implements java.io.Serializable

An immutable, random-access list of Address objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
AddressList(java.util.List<? extends Address> addresses, boolean dontCopy)
           
 
Method Summary
 MailboxList flatten()
          Returns a flat list of all mailboxes represented in this address list.
 Address get(int index)
          Gets an address.
static void main(java.lang.String[] args)
          Test console.
static AddressList parse(java.lang.String rawAddressList)
          Parse the address list string, such as the value of a From, To, Cc, Bcc, Sender, or Reply-To header.
 void print()
          Dumps a representation of this address list to stdout, for debugging purposes.
 int size()
          The number of elements in this list.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

AddressList

public AddressList(java.util.List<? extends Address> addresses,
                   boolean dontCopy)
Parameters:
addresses - A List that contains only Address objects.
dontCopy - true iff it is not possible for the addresses list to be modified by someone else.
Method Detail

size

public int size()
The number of elements in this list.

Specified by:
size in interface java.util.Collection<Address>
Specified by:
size in interface java.util.List<Address>
Specified by:
size in class java.util.AbstractCollection<Address>

get

public Address get(int index)
Gets an address.

Specified by:
get in interface java.util.List<Address>
Specified by:
get in class java.util.AbstractList<Address>

flatten

public MailboxList flatten()
Returns a flat list of all mailboxes represented in this address list. Use this if you don't care about grouping.


print

public void print()
Dumps a representation of this address list to stdout, for debugging purposes.


parse

public static AddressList parse(java.lang.String rawAddressList)
                         throws ParseException
Parse the address list string, such as the value of a From, To, Cc, Bcc, Sender, or Reply-To header. The string MUST be unfolded already.

Throws:
ParseException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Test console.

Throws:
java.lang.Exception


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.