Package RelLib :: Module _AddressBase :: Class AddressBase
[frames] | no frames]

Class AddressBase

source code


Base class for address-aware objects.

Instance Methods
 
__init__(self, source=None)
Initialize a AddressBase.
source code
 
add_address(self, address)
Adds the Address instance to the object's list of addresses
source code
list
get_address_list(self)
Returns the list of Address instances associated with the object
source code
bool
remove_address(self, address)
Removes the specified Address instance from the address list If the instance does not exist in the list, the operation has no effect.
source code
 
serialize(self)
Converts the object to a serialized tuple of data
source code
 
set_address_list(self, address_list)
Assigns the passed list to the object's list of Address instances.
source code
 
unserialize(self, data)
Converts a serialized tuple of data to an object
source code
Method Details

__init__(self, source=None)
(Constructor)

source code 
Initialize a AddressBase. If the source is not None, then object is initialized from values of the source object.
Parameters:
  • source (AddressBase) - Object used to initialize the new object

add_address(self, address)

source code 
Adds the Address instance to the object's list of addresses
Parameters:
  • address (list) - Address instance to add to the object's address list

get_address_list(self)

source code 
Returns the list of Address instances associated with the object
Returns: list
Returns the list of Address instances

remove_address(self, address)

source code 
Removes the specified Address instance from the address list If the instance does not exist in the list, the operation has no effect.
Parameters:
Returns: bool
True if the address was removed, False if it was not in the list.

set_address_list(self, address_list)

source code 
Assigns the passed list to the object's list of Address instances.
Parameters:
  • address_list (list) - List of Address instances to be associated with the object