Class AddressList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<Address>
-
- org.apache.james.mime4j.dom.address.AddressList
-
- All Implemented Interfaces:
Serializable,Iterable<Address>,Collection<Address>,List<Address>
public class AddressList extends AbstractList<Address> implements 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
Constructors Constructor Description AddressList(List<? extends Address> addresses)AddressList(List<? extends Address> addresses, boolean dontCopy)AddressList(Address... addresses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MailboxListflatten()Returns a flat list of all mailboxes represented in this address list.Addressget(int index)Gets an address.intsize()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.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
AddressList
public AddressList(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.
-
AddressList
public AddressList(List<? extends Address> addresses)
- Parameters:
addresses- A List that contains only Address objects.
-
AddressList
public AddressList(Address... addresses)
- Parameters:
addresses- A List that contains only Address objects.
-
-
Method Detail
-
size
public int size()
The number of elements in this list.- Specified by:
sizein interfaceCollection<Address>- Specified by:
sizein interfaceList<Address>- Specified by:
sizein classAbstractCollection<Address>
-
get
public Address get(int index)
Gets an 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.
-
-