|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.hunnysoft.jmime.Node
com.hunnysoft.jmime.FieldBody
com.hunnysoft.jmime.AddressList
public class AddressList
Class that represents a list of RFC 2822 mail addresses.
AddressList represents a list of mail addresses as
described in
RFC 2822. In Hunny JMIME, AddressList is a
container for objects of type Address, and it contains various
methods to manage its contained objects. AddressList is
also a FieldBody. This reflects the fact that certain
RFC 2822 header fields, such as the "To" header field, have a list
of addresses as their field bodies.
| Field Summary |
|---|
| Fields inherited from class com.hunnysoft.jmime.FieldBody |
|---|
mText |
| Fields inherited from class com.hunnysoft.jmime.Node |
|---|
mIsModified, mParent, mString |
| Constructor Summary | |
|---|---|
AddressList()
Default constructor. |
|
AddressList(AddressList other)
Copy constructor. |
|
AddressList(ByteString bstr)
Constructor that takes an initial byte string argument. |
|
| Method Summary | |
|---|---|
void |
addAddress(Address address)
Adds an address to the end of the list. |
Address |
addressAt(int index)
Gets the address at the specified position. |
void |
assemble()
Assembles the string representation. |
java.lang.Object |
clone()
Creates a copy of this object. |
void |
deleteAllAddresses()
Deletes all addresses in the list. |
void |
insertAddressAt(int index,
Address address)
Inserts an address at the specified position. |
int |
numAddresses()
Gets the number of addresses in the list. |
void |
parse()
Parses the string representation. |
Address |
removeAddressAt(int index)
Removes the address at the specified position. |
| Methods inherited from class com.hunnysoft.jmime.FieldBody |
|---|
fold, isFoldingEnabled, maybeFold, setFoldingEnabled, setText, text, unfold |
| Methods inherited from class com.hunnysoft.jmime.Node |
|---|
_setString, isModified, parent, setModified, setParent, setString, string, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AddressList()
This constructor sets the AddressList object's
string representation to the empty string and sets its parent node
to null. The list of Address objects is
initially empty.
public AddressList(AddressList other)
This constructor performs a deep copy of its argument. The
parent node of the new AddressList object is set to
null.
other - AddressList instance to copypublic AddressList(ByteString bstr)
This constructor sets the AddressList object's
string representation to bstr and sets its parent node
to null.
Normally, you call the parse() method immediately after
this constructor to create the broken-down representation.
bstr - initial value for the string representation| Method Detail |
|---|
public java.lang.Object clone()
This method, inherited from Object, creates a new
AddressList object that has the same value as this
AddressList object. The parent node of the new
AddressList object is set to null.
clone in class FieldBodypublic void parse()
This method, inherited from Node, executes the parse
operation for AddressList objects. The parse operation
creates or updates the broken-down representation from the string
representation. For AddressList objects, the parse
operation parses the string representation to create a list of
Address objects. This method also calls the
parse() method of each Address object in
its list.
You should call this method after you set or modify the string
representation, and before you access any of the contained Address objects.
This method clears the is-modified flag.
parse in class FieldBodyNode.assemble()public void assemble()
This method, inherited from Node, executes the assemble
operation for AddressList objects. The assemble
operation creates or updates the string representation from the
broken-down representation. For AddressList objects,
the assemble operation builds the string representation from the
list of contained Address objects. Before it builds the
string representation for the AddressList object, this
method first calls the assemble() method of each
Address object in its list.
You should call this method after you set or modify any of the
contained Address objects, and before you retrieve the
string representation.
This method clears the is-modified flag.
assemble in class FieldBodyNode.parse()public int numAddresses()
public void addAddress(Address address)
address - Address object to addpublic void deleteAllAddresses()
public Address addressAt(int index)
index - position of the Address object to get
(0 <= index < numAddresses())
Address object at the specified position
java.lang.IndexOutOfBoundsException - if index is out of range
public void insertAddressAt(int index,
Address address)
Inserting at position 0 inserts the address at the beginning.
Inserting at position numAddresses() appends the
address to the end.
index - position in the list to insert the
Address object
(0 <= index <= numAddresses())address - Address object to insert
java.lang.IndexOutOfBoundsException - if index is out of rangepublic Address removeAddressAt(int index)
index - position of the Address object to remove
(0 <= index < numAddresses())
Address object
java.lang.IndexOutOfBoundsException - if index is out of range
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||