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

java.lang.Object
  extended by org.apache.james.mime4j.field.address.DomainList

public class DomainList
extends java.lang.Object

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


Constructor Summary
DomainList(java.util.ArrayList 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 ':').
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomainList

public DomainList(java.util.ArrayList domains,
                  boolean dontCopy)
Parameters:
domains - An ArrayList that contains only String objects.
dontCopy - true iff it is not possible for the domains ArrayList to be modified by someone else.
Method Detail

size

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


get

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

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 ':').



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