![]() |
Python_2
1.0
|
Class for holding an address book. More...
Public Member Functions | |
def | __init__ (self) |
Constructor. More... | |
def | putPhone (self, nome, lista) |
Associates new phones to the given name. More... | |
def | getPhone (self, nome, index) |
Retrieves the index-th phone of a given contact. More... | |
def | __eq__ (self, other) |
Compares two agendas. More... | |
def | remContact (self, nome) |
Removes a given contact from the address book. More... | |
def | __repr__ (self) |
Used to print a human readable presentation of an object. More... | |
def | __str__ (self) |
For printing an address book x by using just print x. More... | |
Public Attributes | |
dic | |
Dictionary for associating a contact name to a telephone list. More... | |
Class for holding an address book.
def _01b_Agenda.Agenda.__init__ | ( | self | ) |
Constructor.
Just creates an empty dictionary.
def _01b_Agenda.Agenda.__eq__ | ( | self, | |
other | |||
) |
Compares two agendas.
References _01b_Agenda.Agenda.dic.
def _01b_Agenda.Agenda.__repr__ | ( | self | ) |
Used to print a human readable presentation of an object.
In this case, it prints the contact name and his phone numbers.
References _01b_Agenda.Agenda.dic.
def _01b_Agenda.Agenda.__str__ | ( | self | ) |
For printing an address book x by using just print x.
Each line is made up of a name followed by its corresponding phones. Names are listed in alphabetical order.
References _01b_Agenda.Agenda.dic.
def _01b_Agenda.Agenda.getPhone | ( | self, | |
nome, | |||
index | |||
) |
Retrieves the index-th phone of a given contact.
nome | contact name. |
index | selects a certain phone from the contact phone list. |
References _01b_Agenda.Agenda.dic.
def _01b_Agenda.Agenda.putPhone | ( | self, | |
nome, | |||
lista | |||
) |
Associates new phones to the given name.
nome | contact name. |
lista | contact phone list. |
References _01b_Agenda.Agenda.dic.
def _01b_Agenda.Agenda.remContact | ( | self, | |
nome | |||
) |
Removes a given contact from the address book.
nome | contact name. |
References _01b_Agenda.Agenda.dic.
_01b_Agenda.Agenda.dic |
Dictionary for associating a contact name to a telephone list.
Referenced by _01b_Agenda.Agenda.__eq__(), _01d_Agenda.Agenda.__eq__(), _01b_Agenda.Agenda.__repr__(), _01d_Agenda.Agenda.__repr__(), _01b_Agenda.Agenda.__str__(), _01d_Agenda.Agenda.__str__(), _01d_Agenda.Agenda.getAddr(), _01b_Agenda.Agenda.getPhone(), _01d_Agenda.Agenda.getPhone(), _01b_Agenda.Agenda.putPhone(), _01d_Agenda.Agenda.putPhone(), _01b_Agenda.Agenda.remContact(), and _01d_Agenda.Agenda.remContact().