|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.Vector
AddressBook
An object of this class maintains the collection of Person objects that constitute an address book
Field Summary |
Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
AddressBook()
Constructor - create a new, empty address book |
Method Summary | |
void |
addPerson(java.lang.String firstName,
java.lang.String lastName,
java.lang.String address,
java.lang.String city,
java.lang.String state,
java.lang.String zip,
java.lang.String phone)
Add a new Person to the collection |
boolean |
getChangedSinceLastSave()
Find out whether this address book has been changed since last open / save |
java.io.File |
getFile()
Get the File this address book was most recently read from or saved to |
java.lang.String |
getFullNameOfPerson(int index)
Provide the full name of a person |
java.lang.String[] |
getOtherPersonInformation(int index)
Provide the rest of the current information about a person |
java.lang.String |
getTitle()
Get the title of this address book - based on the most recently used file |
void |
printAll()
Print the collection of persons in order. |
void |
removePerson(int index)
Remove a specific person from the collection |
void |
setChangedSinceLastSave(boolean changedSinceLastSave)
Record a change in the saved status of this address book |
void |
setFile(java.io.File file)
Set the File this address book was most recently read from or saved to |
void |
sortByName()
Sort the collection by name |
void |
sortByZip()
Sort the collection by ZIP |
void |
updatePerson(int index,
java.lang.String address,
java.lang.String city,
java.lang.String state,
java.lang.String zip,
java.lang.String phone)
Update stored information about a person |
Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.util.AbstractList |
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
iterator, listIterator, listIterator |
Constructor Detail |
public AddressBook()
Method Detail |
public void addPerson(java.lang.String firstName, java.lang.String lastName, java.lang.String address, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String phone)
firstName
- the person's first namelastName
- the person's last nameaddress
- the person's addresscity
- the person's citystate
- the person's statezip
- the person's zipphone
- the person's phonepublic java.lang.String getFullNameOfPerson(int index)
index
- the position of the desired person
public java.lang.String[] getOtherPersonInformation(int index)
index
- the position of the desired person
public void updatePerson(int index, java.lang.String address, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String phone)
index
- the position of the desired personaddress
- the person's new addresscity
- the person's new citystate
- the person's new statezip
- the person's new zipphone
- the person's new phonepublic void removePerson(int index)
index
- the position of the desired personpublic void sortByName()
public void sortByZip()
public void printAll()
public java.io.File getFile()
public java.lang.String getTitle()
public void setFile(java.io.File file)
file
- the file just used to read or save this objectpublic boolean getChangedSinceLastSave()
public void setChangedSinceLastSave(boolean changedSinceLastSave)
changedSinceLastSave
- the new status
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |