university
Class CategoryDirectory

java.lang.Object
  extended by university.CategoryDirectory
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Directory

public class CategoryDirectory
extends java.lang.Object
implements Directory, java.io.Serializable, java.lang.Cloneable

CategoryDirectory containing the people of the university.

See Also:
Serialized Form

Constructor Summary
CategoryDirectory()
          Creates a new instance of UniversityDirectory
 
Method Summary
 void add(Person person)
          Add a Person to the UniversityDirectory
 java.lang.Object clone()
          Clone a new object
 java.lang.String displayCategory(int categorySelection)
           
 java.lang.String listAll()
          List all people in the directory
 void remove(Person person)
          Remove a Person from the UniversityDirectory
 Person search(int id)
          Search for a Person by ID.
 Person search(java.lang.String name)
          Search for a Person by name.
 java.lang.String size()
          List the size for each category member of the university.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategoryDirectory

public CategoryDirectory()
Creates a new instance of UniversityDirectory

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone a new object

Overrides:
clone in class java.lang.Object
Returns:
Object a cloned object
Throws:
java.lang.CloneNotSupportedException - Throws CloneNotSupportedException

add

public void add(Person person)
Add a Person to the UniversityDirectory

Specified by:
add in interface Directory
Parameters:
person - The person to add to the UniversityDirectory

remove

public void remove(Person person)
Remove a Person from the UniversityDirectory

Specified by:
remove in interface Directory
Parameters:
person - The person to remove from the UniversityDirectory

listAll

public java.lang.String listAll()
List all people in the directory

Specified by:
listAll in interface Directory

size

public java.lang.String size()
List the size for each category member of the university.

Returns:
String listing the number of people in each category.

search

public Person search(java.lang.String name)
Search for a Person by name.

Specified by:
search in interface Directory
Parameters:
name - the name of the Person
Returns:
the person

search

public Person search(int id)
Search for a Person by ID.

Specified by:
search in interface Directory
Parameters:
id - the ID number of the Person
Returns:
the person

displayCategory

public java.lang.String displayCategory(int categorySelection)