university
Class DirectoryFacade

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

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

Facade to inteface with the Unit and University Directory.

See Also:
Serialized Form

Constructor Summary
DirectoryFacade()
          Creates a new instance of DirectoryFacade
DirectoryFacade(DirectoryFacade directory)
          Creates a new instance of the DirectoryFacade
 
Method Summary
 void add(Person person)
          Add a Person to the UniversityDirectory
 java.lang.Object clone()
          Clone a new Directoryfacade object
 java.lang.String displayCategory()
          Display all the people of a certain category.
 java.lang.String displayUnit()
           
 java.lang.String listAll()
          List all people in the directory.
 void remove(Person person)
          Remove a Person from the UniversityDirectory.
 Person search()
          Search for a Person, reads in input from the console then finds the Person in the directory.
 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()
          Get the size of all the units and categories of people in the directory.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryFacade

public DirectoryFacade()
Creates a new instance of DirectoryFacade


DirectoryFacade

public DirectoryFacade(DirectoryFacade directory)
Creates a new instance of the DirectoryFacade

Parameters:
directory - a DirectoryFacade to make a copy of.
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone a new Directoryfacade 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
Returns:
String with a list of all people in the 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

search

public Person search()
Search for a Person, reads in input from the console then finds the Person in the directory.

Returns:
Person found in the directory or null if not found.

size

public java.lang.String size()
Get the size of all the units and categories of people in the directory.

Returns:
String list the size of the units and categories

displayUnit

public java.lang.String displayUnit()

displayCategory

public java.lang.String displayCategory()
Display all the people of a certain category.

Returns:
String A String listing all people in a category.