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

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

public class DomainList
extends java.util.AbstractList<java.lang.String>
implements java.io.Serializable

An immutable, random-access list of Strings (that are supposedly domain names or domain literals).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
DomainList(java.util.List<java.lang.String> domains, boolean dontCopy)
           
 
Method Summary
 java.lang.String get(int index)
          Gets the domain name or domain literal at the specified index.
 int size()
          The number of elements in this list.
 java.lang.String toRouteString()
          Returns the list of domains formatted as a route string (not including the trailing ':').
 java.lang.String toString()
           
 
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
 
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

DomainList

public DomainList(java.util.List<java.lang.String> domains,
                  boolean dontCopy)
Parameters:
domains - A List that contains only String objects.
dontCopy - true iff it is not possible for the domains 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<java.lang.String>
Specified by:
size in interface java.util.List<java.lang.String>
Specified by:
size in class java.util.AbstractCollection<java.lang.String>

get

public java.lang.String get(int index)
Gets the domain name or domain literal at the specified index.

Specified by:
get in interface java.util.List<java.lang.String>
Specified by:
get in class java.util.AbstractList<java.lang.String>
Throws:
java.lang.IndexOutOfBoundsException - If index is < 0 or >= size().

toRouteString

public java.lang.String toRouteString()
Returns the list of domains formatted as a route string (not including the trailing ':').


toString

public java.lang.String toString()
Overrides:
toString in class java.util.AbstractCollection<java.lang.String>


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