You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



All Packages  This Package  Class Hierarchy  Class Search  Index

Class grendel.storage.addressparser.RFC822AddressList

java.lang.Object
   |
   +----grendel.storage.addressparser.RFC822AddressList

This class lets you instantiate an address list object from an input string (usually the right hand side to a To: field). You can then detect if they were all valid addresses, or there was some error. You can also access the individual address string to send the address list back out again.


public class  RFC822AddressList
     extends java.lang.Object
{
          // Fields 2
     Vector all_tokens;
     RFC822AddressParser parser;

          // Constructors 2
     RFC822AddressList();
     public RFC822AddressList(String);

          // Methods 4
     public String getAddressString(int);
     public String getErrorString();
     public boolean isError();
     public int size();
}



Fields


parser

   RFC822AddressParser parser


all_tokens

   Vector all_tokens



Constructors


RFC822AddressList

   RFC822AddressList() 

This constructor seems to be needed in order to subclass this class. It should never be directly called as it will create a null and basically useless address list.



RFC822AddressList

   public RFC822AddressList(String str) 

The input string (usually a To: field) is first tokenized, and then parsed into a list of addresses.




Methods


size

   public int size() 

Returns:
Returns the number of addresses in the list. The string representation for each address is indexed from 0 to (size - 1). A return of 0 means an empty address list, probably a result of an error in parsing.


getAddressString

   public String getAddressString(int indx) 

Parameter Description
indx an index from 0 to (size - 1).

Returns:
Either a String representation of the address, or null if the indx is outside the list. Also returns null is there was an error which resulted in no address list.


isError

   public boolean isError() 

Were there errors in tokenizing and parsing this string?



getErrorString

   public String getErrorString() 

Returns:
A string describing the error if there was one. Some errors can return an empty string. No error in the address list returns "No error."


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4