Class ListOfEmployees

java.lang.Object
  |
  +--ListOfEmployees
All Implemented Interfaces:
java.lang.Cloneable

public class ListOfEmployees
extends java.lang.Object
implements java.lang.Cloneable

Is a representation of a list of employees.


Field Summary
private  java.util.Vector data
          A vector of employees
 
Constructor Summary
ListOfEmployees()
          Constructs an empty list of employees
ListOfEmployees(java.util.Vector employees)
          Constructs the list of employees from a vector of employees
 
Method Summary
 void AddEmployee(Employees toAdd)
          Adds an employee to the list
 java.lang.Object clone()
          Creates a copy of the current object
 Employees GetEmployee(java.lang.String employeeName)
          Pre-conditions: A valid variable of type String is passed.
 java.util.Vector GetEmployeeNames()
          Pre-conditions: none Post-conditions: Returns the vector of employees.
 boolean IsIn(Employees toCheck)
          Pre-conditions: A valid variable of type of Employees is passed.
 void RemoveEmployees(java.util.Vector toRemove)
          Removes employees from the list
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

data

private java.util.Vector data
A vector of employees
Constructor Detail

ListOfEmployees

public ListOfEmployees()
Constructs an empty list of employees

Pre-conditions: none
Post-conditions: The vector of data for this class is initialized.


ListOfEmployees

public ListOfEmployees(java.util.Vector employees)
Constructs the list of employees from a vector of employees

Pre-conditions: A valid vector of employees is passed.
Post-conditions: The passed vector of employees is added to the private vector of employees.

Parameters:
employees - a vector of employees that need to be added to the list
Method Detail

AddEmployee

public void AddEmployee(Employees toAdd)
Adds an employee to the list

Pre-conditions: A valid variable of type Employees is passed.
Post-conditions: The passed variable is added to the private vector of employees.

Parameters:
toAdd - the employee that needs to be added to the list; if the employee is already in the list (or an employee with the same name is), then the employee will not be added.

RemoveEmployees

public void RemoveEmployees(java.util.Vector toRemove)
Removes employees from the list

Pre-conditions: A valid vector of employees is passed.
Post-conditions: The passed vector of employees are removed from the private vector of employees, that is if they are in the list.

Parameters:
toRemove - the vector of employees that need to be removed from the list; employees are removed by name and therefore that is all that is important when sending a vector of employees to be removed

GetEmployeeNames

public java.util.Vector GetEmployeeNames()
Pre-conditions: none Post-conditions: Returns the vector of employees.

GetEmployee

public Employees GetEmployee(java.lang.String employeeName)
Pre-conditions: A valid variable of type String is passed. Post-conditions: If the passed employee's name is in the private vector of employees, then returns the employee.

IsIn

public boolean IsIn(Employees toCheck)
Pre-conditions: A valid variable of type of Employees is passed. Post-conditions: The private vector of employees is searched for the passed employee, Returns True if found, False if not found.

clone

public java.lang.Object clone()
Creates a copy of the current object

Pre-conditions: none
Post-conditions: A copy of the current ListOfEmployees object is returned.

Overrides:
clone in class java.lang.Object
Returns:
the copy