university
Class UnitDirectory

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

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

Direcotory of all the units of the university.

See Also:
Serialized Form

Constructor Summary
UnitDirectory()
          Creates a new instance of UnivDirectory
 
Method Summary
 void add(Person person)
          Add a Person to the UniversityDirectory
 java.lang.Object clone()
          Clone a new object
 java.lang.String displayUnit(int categorySelection)
          Displays all people of a certain category: 1 - cis, 2 - education, 3 - library, 4 - hr, 5 - addmission.
 java.lang.String listAll()
          List all people in the directory String Listing all members of the university.
 void remove(Person person)
          Remove a Person from the UnitDirectory
 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()
          Lists the how many people are in each unit.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitDirectory

public UnitDirectory()
Creates a new instance of UnivDirectory

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 UnitDirectory

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

listAll

public java.lang.String listAll()
List all people in the directory String Listing all members of the university.

Specified by:
listAll in interface Directory

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

displayUnit

public java.lang.String displayUnit(int categorySelection)
Displays all people of a certain category: 1 - cis, 2 - education, 3 - library, 4 - hr, 5 - addmission. categorySelector the category to display.


size

public java.lang.String size()
Lists the how many people are in each unit. String A listing the number of people affiliated with each unit.