|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.deas.hyperenc.ContactList
public abstract class ContactList
A list of Contacts. Implements a subset of the List interface, and an
additional method, getContact
, that finds the Contact in the
list with the given e-mail address.
Constructor Summary | |
---|---|
protected |
ContactList()
Default constructor |
Method Summary | |
---|---|
abstract void |
addContact(Contact c)
Appends c to the list. |
abstract Contact |
get(int index)
Returns the contact at index index in the list. |
abstract Contact |
getContact(Address a)
Returns the Contact in this list with e-mail address a . |
boolean |
isEmpty()
Returns whether this list is empty. |
abstract Iterator<Contact> |
iterator()
Returns an Iterator over the Contacts in this list. |
abstract void |
removeContact(Contact c)
Removes c from the list. |
abstract int |
size()
Returns the number of contacts in the list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ContactList()
Method Detail |
---|
public abstract void addContact(Contact c)
c
to the list.
c
- the contact to be addedpublic abstract void removeContact(Contact c)
c
from the list.
c
- the contact to be removedpublic abstract Contact get(int index) throws IndexOutOfBoundsException
index
in the list.
index
- an integer index between 0 and this.size() - 1
IndexOutOfBoundsException
- if the value of index
is illegalpublic abstract Iterator<Contact> iterator()
iterator
in interface Iterable<Contact>
public abstract int size()
public boolean isEmpty()
true
iff the size of this list is 0public abstract Contact getContact(Address a)
a
.
a
- e-mail address
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |