
Public Member Functions | |
| AddressList () | |
| Default constructor. | |
| AddressList (const AddressList &other) | |
| Copy constructor. | |
| AddressList (const String &str, Node *parent=0) | |
| Constructor that takes an initial string and parent node. | |
| virtual | ~AddressList () |
| Destructor. | |
| const AddressList & | operator= (const AddressList &other) |
| Assignment operator. | |
| virtual void | parse () |
| Parses the string representation. | |
| virtual void | assemble () |
| Assembles the string representation. | |
| virtual Node * | clone () const |
| Creates a copy of this object. | |
| int | numAddresses () const |
| Gets the number of addresses in the list. | |
| void | addAddress (Address *address) |
| Adds an address to the end of the list. | |
| void | deleteAllAddresses () |
| Deletes all addresses in the list. | |
| Address & | addressAt (int index) const |
| Gets the address at the specified position in the list. | |
| void | insertAddressAt (int index, Address *address) |
| Inserts an address at the specified position in the list. | |
| Address * | removeAddressAt (int index) |
| Removes the address at the specified position in the list. | |
Static Public Member Functions | |
| static AddressList * | newAddressList () |
| Creates a new instance. | |
Static Public Attributes | |
| static AddressList *(* | sNewAddressList )() |
| Provides a class factory hook. | |
Protected Member Functions | |
| void | _copyAddresses (const AddressList &list) |
| Copies all addresses from another list. | |
| void | _addAddress (Address *address) |
| Adds an address to the end of the list. | |
| void | _insertAddressAt (int index, Address *address) |
| Inserts an address at the specified position in the list. | |
| Address * | _removeAddressAt (int index) |
| Removes the address at the specified position in the list. | |
| void | _deleteAllAddresses () |
| Deletes all addresses in the list. | |
| AddressList | ( | ) |
This constructor sets the AddressList object's string representation to the empty string and sets its parent node to NULL.
| AddressList | ( | const 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 copy |
| AddressList | ( | const String & | str, | |
| Node * | parent = 0 | |||
| ) |
This constructor sets the AddressList object's string representation to str and sets its parent node to parent.
Normally, you call the virtual function parse() immediately after this constructor to create the broken-down representation.
| str | initial value for the string representation | |
| parent | parent node for this object |
| ~AddressList | ( | ) | [virtual] |
Destructor
| void _addAddress | ( | Address * | address | ) | [protected] |
Same as addAddress(), but does not set the is-modified flag.
| address | Address object to add |
| void _copyAddresses | ( | const AddressList & | list | ) | [protected] |
Copies the list of Address objects from list. Assumes the list in this AddressList object is emtpy. Does not set the is-modified flag.
| list | AddressList object to copy Address objects from |
| void _deleteAllAddresses | ( | ) | [protected] |
| void _insertAddressAt | ( | int | index, | |
| Address * | addr | |||
| ) | [protected] |
Same as insertAddressAt(), but does not set the is-modified flag.
| index | position in the list to insert the Address object | |
| addr | Address object to insert |
| Address * _removeAddressAt | ( | int | index | ) | [protected] |
Same as removeAddressAt(), but does not set the is-modified flag.
| index | position of the Address object to remove |
| void addAddress | ( | Address * | address | ) |
Adds address to the end of the list.
The AddressList destructor deletes the Address objects in the list.
| address | Address object to add |
| Address & addressAt | ( | int | index | ) | const |
Gets the Address object at position index in the list.
The function's behavior is undefined if index is out of range. Valid values for index are 0 <= index < numAddresses().
| index | position of the Address object to get |
| void assemble | ( | ) | [virtual] |
This virtual function, 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, the function first calls the assemble() member function of each Address object in its list.
You should call this member function after you set or modify any of the contained Address objects, and before you retrieve the string representation.
This function clears the is-modified flag.
Reimplemented from FieldBody.
| Node * clone | ( | ) | const [virtual] |
| void deleteAllAddresses | ( | ) |
Removes and deletes all Address objects in the list.
| void insertAddressAt | ( | int | index, | |
| Address * | address | |||
| ) |
Inserts address into the list at position index.
If index is zero, then the function inserts address into the first position in the list. If index equals numAddresses(), then the function inserts address into the last position in the list. If index is less than numAddresses(), then the function moves the Address objects at position index or greater to a higher position in the list.
The AddressList destructor deletes the Address objects in the list.
The function's behavior is undefined if index is out of range. Valid values for index are 0 <= index <= numAddresses().
| index | position in the list to insert the Address object | |
| address | Address object to insert |
| AddressList * newAddressList | ( | ) | [static] |
Creates a new AddressList object.
If the static data member sNewAddressList is NULL, this member function creates a new AddressList object and returns it. Otherwise, newAddressList() calls the user-supplied function that sNewAddressList points to and returns the object created by that function.
| int numAddresses | ( | ) | const |
| const AddressList & operator= | ( | const AddressList & | other | ) |
Performs a deep copy of its argument. The parent node of this AddressList object is not changed.
| other | AddressList instance to copy |
| void parse | ( | ) | [virtual] |
This virtual function, 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 member function also calls the parse() member function of each Address object in its list.
You should call this member function after you set or modify the string representation, and before you access any of the contained Address objects.
This function clears the is-modified flag.
Reimplemented from FieldBody.
| Address * removeAddressAt | ( | int | index | ) |
Removes the Address object at position index from the list and returns it.
If index is less than numAddresses()-1, then the function moves the Address objects at position (index + 1) or greater to a lower position in the list.
The function's behavior is undefined if index is out of range. Valid values for index are 0 <= index < numAddresses().
| index | position of the Address object to remove |
| AddressList *(* sNewAddressList)()=0 | ( | ) | [static] |
If sNewAddressList is not NULL, it must point to a user-supplied function that returns a new instance of a subclass of AddressList.
Copyright © 2001-2009 Hunny Software, Inc. All rights reserved.