org.apache.jdo.tck.pc.company
Class Employee

java.lang.Object
  extended byorg.apache.jdo.tck.pc.company.Person
      extended byorg.apache.jdo.tck.pc.company.Employee
All Implemented Interfaces:
java.lang.Comparable, java.util.Comparator, DeepEquality, IEmployee, IPerson, java.io.Serializable
Direct Known Subclasses:
FullTimeEmployee, PartTimeEmployee

public abstract class Employee
extends Person
implements IEmployee

This class represents an employee.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.apache.jdo.tck.pc.company.Person
Person.Oid
 
Field Summary
 
Fields inherited from class org.apache.jdo.tck.pc.company.Person
formatter
 
Constructor Summary
protected Employee()
          This is the JDO-required no-args constructor
  Employee(long personid, java.lang.String firstname, java.lang.String lastname, java.lang.String middlename, java.util.Date birthdate, java.util.Date hiredate)
          Construct an Employee instance.
  Employee(long personid, java.lang.String firstname, java.lang.String lastname, java.lang.String middlename, java.util.Date birthdate, IAddress address, java.util.Date hiredate)
          Construct an Employee instance.
 
Method Summary
 void addAdvisee(Employee emp)
          Add an Employee as an advisee of this HR advisor.
 void addProject(Project project)
          Add a project for the employee.
 void addReviewedProjects(Project project)
          Add a reviewed project.
 void addToTeam(Employee emp)
          Add an Employee to this employee's team.
 boolean deepCompareFields(java.lang.Object other, EqualityHelper helper)
          Returns true if all the fields of this instance are deep equal to the corresponding fields of the specified Employee.
 IDentalInsurance getDentalInsurance()
          Get the dental insurance of the employee.
 IDepartment getDepartment()
          Get the employee's department.
protected  java.lang.String getFieldRepr()
          Returns a String representation of the non-relationship fields.
 IDepartment getFundingDept()
          Get the employee's funding department.
 java.util.Date getHiredate()
          Get the date that the employee was hired.
 java.util.Set getHradvisees()
          Get the HR advisees of this HR advisor.
 IEmployee getHradvisor()
          Get the HR advisor for the employee.
 IEmployee getManager()
          Get the employee's manager.
 IMedicalInsurance getMedicalInsurance()
          Get the medical insurance of the employee.
 IEmployee getMentor()
          Get the mentor for this employee.
 java.util.Set getProjects()
          Get the employee's projects.
 IEmployee getProtege()
          Get the protege of this employee.
 java.util.Set getReviewedProjects()
          Get the reviewed projects.
 java.util.Set getTeam()
          Get the employee's team.
 double getWeeklyhours()
          Get the weekly hours of the employee.
 void removeAdvisee(Employee emp)
          Remove an Employee as an advisee of this HR advisor.
 void removeFromTeam(Employee emp)
          Remove an Employee from this employee's team.
 void removeProject(Project project)
          Remove a project from an employee's set of projects.
 void removeReviewedProject(Project project)
          Remove a reviewed project.
 void setDentalInsurance(IDentalInsurance dentalInsurance)
          Set the dental insurance object for the employee.
 void setDepartment(IDepartment department)
          Set the employee's department.
 void setFundingDept(IDepartment department)
          Set the employee's funding department.
 void setHiredate(java.util.Date hiredate)
          Set the date that the employee was hired.
 void setHradvisees(java.util.Set hradvisees)
          Set the HR advisees of this HR advisor.
 void setHradvisor(IEmployee hradvisor)
          Set the HR advisor for this employee.
 void setManager(IEmployee manager)
          Set the employee's manager.
 void setMedicalInsurance(IMedicalInsurance medicalInsurance)
          Set the medical insurance object for the employee.
 void setMentor(IEmployee mentor)
          Set the mentor for this employee.
 void setProjects(java.util.Set projects)
          Set the projects for the employee.
 void setProtege(IEmployee protege)
          Set the protege for this employee.
 void setReviewedProjects(java.util.Set reviewedProjects)
          Set the reviewed projects for the employee.
 void setTeam(java.util.Set team)
          Set the employee's team.
 void setWeeklyhours(double weeklyhours)
          Set the number of hours per week that the employee works.
 java.lang.String toString()
          Return a String representation of a Employee object.
 
Methods inherited from class org.apache.jdo.tck.pc.company.Person
compare, compare, compareTo, compareTo, equals, getAddress, getBirthdate, getFirstname, getLastname, getMiddlename, getPersonid, getPhoneNumber, getPhoneNumbers, hashCode, putPhoneNumber, removePhoneNumber, setAddress, setBirthdate, setFirstname, setLastname, setLastname, setMiddlename, setPersonid, setPhoneNumbers
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jdo.tck.pc.company.IPerson
getAddress, getBirthdate, getFirstname, getLastname, getMiddlename, getPersonid, getPhoneNumbers, setAddress, setBirthdate, setFirstname, setLastname, setMiddlename, setPersonid, setPhoneNumbers
 

Constructor Detail

Employee

protected Employee()
This is the JDO-required no-args constructor


Employee

public Employee(long personid,
                java.lang.String firstname,
                java.lang.String lastname,
                java.lang.String middlename,
                java.util.Date birthdate,
                java.util.Date hiredate)
Construct an Employee instance.

Parameters:
personid - The identifier for the person.
firstname - The first name of the employee.
lastname - The last name of the employee.
middlename - The middle name of the employee.
birthdate - The birth date of the employee.
hiredate - The date that the employee was hired.

Employee

public Employee(long personid,
                java.lang.String firstname,
                java.lang.String lastname,
                java.lang.String middlename,
                java.util.Date birthdate,
                IAddress address,
                java.util.Date hiredate)
Construct an Employee instance.

Parameters:
personid - The identifier for the person.
firstname - The first name of the employee.
lastname - The last name of the employee.
middlename - The middle name of the employee.
birthdate - The birth date of the employee.
address - The address of the employee.
hiredate - The date that the employee was hired.
Method Detail

getHiredate

public java.util.Date getHiredate()
Get the date that the employee was hired.

Specified by:
getHiredate in interface IEmployee
Returns:
The date the employee was hired.

setHiredate

public void setHiredate(java.util.Date hiredate)
Set the date that the employee was hired.

Specified by:
setHiredate in interface IEmployee
Parameters:
hiredate - The date the employee was hired.

getWeeklyhours

public double getWeeklyhours()
Get the weekly hours of the employee.

Specified by:
getWeeklyhours in interface IEmployee
Returns:
The number of hours per week that the employee works.

setWeeklyhours

public void setWeeklyhours(double weeklyhours)
Set the number of hours per week that the employee works.

Specified by:
setWeeklyhours in interface IEmployee
Parameters:
weeklyhours - The number of hours per week that the employee works.

getReviewedProjects

public java.util.Set getReviewedProjects()
Get the reviewed projects.

Specified by:
getReviewedProjects in interface IEmployee
Returns:
The reviewed projects as an unmodifiable set.

addReviewedProjects

public void addReviewedProjects(Project project)
Add a reviewed project.

Parameters:
project - A reviewed project.

removeReviewedProject

public void removeReviewedProject(Project project)
Remove a reviewed project.

Parameters:
project - A reviewed project.

setReviewedProjects

public void setReviewedProjects(java.util.Set reviewedProjects)
Set the reviewed projects for the employee.

Specified by:
setReviewedProjects in interface IEmployee
Parameters:
reviewedProjects - The set of reviewed projects.

getProjects

public java.util.Set getProjects()
Get the employee's projects.

Specified by:
getProjects in interface IEmployee
Returns:
The employee's projects are returned as an unmodifiable set.

addProject

public void addProject(Project project)
Add a project for the employee.

Parameters:
project - The project.

removeProject

public void removeProject(Project project)
Remove a project from an employee's set of projects.

Parameters:
project - The project.

setProjects

public void setProjects(java.util.Set projects)
Set the projects for the employee.

Specified by:
setProjects in interface IEmployee
Parameters:
projects - The set of projects of the employee.

getDentalInsurance

public IDentalInsurance getDentalInsurance()
Get the dental insurance of the employee.

Specified by:
getDentalInsurance in interface IEmployee
Returns:
The employee's dental insurance.

setDentalInsurance

public void setDentalInsurance(IDentalInsurance dentalInsurance)
Set the dental insurance object for the employee.

Specified by:
setDentalInsurance in interface IEmployee
Parameters:
dentalInsurance - The dental insurance object to associate with the employee.

getMedicalInsurance

public IMedicalInsurance getMedicalInsurance()
Get the medical insurance of the employee.

Specified by:
getMedicalInsurance in interface IEmployee
Returns:
The employee's medical insurance.

setMedicalInsurance

public void setMedicalInsurance(IMedicalInsurance medicalInsurance)
Set the medical insurance object for the employee.

Specified by:
setMedicalInsurance in interface IEmployee
Parameters:
medicalInsurance - The medical insurance object to associate with the employee.

getDepartment

public IDepartment getDepartment()
Get the employee's department.

Specified by:
getDepartment in interface IEmployee
Returns:
The department associated with the employee.

setDepartment

public void setDepartment(IDepartment department)
Set the employee's department.

Specified by:
setDepartment in interface IEmployee
Parameters:
department - The department.

getFundingDept

public IDepartment getFundingDept()
Get the employee's funding department.

Specified by:
getFundingDept in interface IEmployee
Returns:
The funding department associated with the employee.

setFundingDept

public void setFundingDept(IDepartment department)
Set the employee's funding department.

Specified by:
setFundingDept in interface IEmployee
Parameters:
department - The funding department.

getManager

public IEmployee getManager()
Get the employee's manager.

Specified by:
getManager in interface IEmployee
Returns:
The employee's manager.

setManager

public void setManager(IEmployee manager)
Set the employee's manager.

Specified by:
setManager in interface IEmployee
Parameters:
manager - The employee's manager.

getTeam

public java.util.Set getTeam()
Get the employee's team.

Specified by:
getTeam in interface IEmployee
Returns:
The set of Employees on this employee's team, returned as an unmodifiable set.

addToTeam

public void addToTeam(Employee emp)
Add an Employee to this employee's team. This method sets both sides of the relationship, modifying this employees team to include parameter emp and modifying emp to set its manager attribute to this object.

Parameters:
emp - The Employee to add to the team.

removeFromTeam

public void removeFromTeam(Employee emp)
Remove an Employee from this employee's team. This method will also set the emp manager to null.

Parameters:
emp - The Employee to remove from the team.

setTeam

public void setTeam(java.util.Set team)
Set the employee's team.

Specified by:
setTeam in interface IEmployee
Parameters:
team - The set of Employees.

setMentor

public void setMentor(IEmployee mentor)
Set the mentor for this employee.

Specified by:
setMentor in interface IEmployee
Parameters:
mentor - The mentor for this employee.

getMentor

public IEmployee getMentor()
Get the mentor for this employee.

Specified by:
getMentor in interface IEmployee
Returns:
The mentor.

setProtege

public void setProtege(IEmployee protege)
Set the protege for this employee.

Specified by:
setProtege in interface IEmployee
Parameters:
protege - The protege for this employee.

getProtege

public IEmployee getProtege()
Get the protege of this employee.

Specified by:
getProtege in interface IEmployee
Returns:
The protege of this employee.

setHradvisor

public void setHradvisor(IEmployee hradvisor)
Set the HR advisor for this employee.

Specified by:
setHradvisor in interface IEmployee
Parameters:
hradvisor - The hradvisor for this employee.

getHradvisor

public IEmployee getHradvisor()
Get the HR advisor for the employee.

Specified by:
getHradvisor in interface IEmployee
Returns:
The HR advisor.

getHradvisees

public java.util.Set getHradvisees()
Get the HR advisees of this HR advisor.

Specified by:
getHradvisees in interface IEmployee
Returns:
An unmodifiable Set containing the Employees that are HR advisees of this employee.

addAdvisee

public void addAdvisee(Employee emp)
Add an Employee as an advisee of this HR advisor. This method also sets the emp hradvisor to reference this object. In other words, both sides of the relationship are set.

Parameters:
emp - The employee to add as an advisee.

removeAdvisee

public void removeAdvisee(Employee emp)
Remove an Employee as an advisee of this HR advisor. This method also sets the emp hradvisor to null. In other words, both sides of the relationship are set.

Parameters:
emp - The employee to add as an HR advisee.

setHradvisees

public void setHradvisees(java.util.Set hradvisees)
Set the HR advisees of this HR advisor.

Specified by:
setHradvisees in interface IEmployee
Parameters:
hradvisees - The Employees that are HR advisees of this employee.

toString

public java.lang.String toString()
Return a String representation of a Employee object.

Overrides:
toString in class Person
Returns:
a String representation of a Employee object.

getFieldRepr

protected java.lang.String getFieldRepr()
Returns a String representation of the non-relationship fields.

Overrides:
getFieldRepr in class Person
Returns:
a String representation of the non-relationship fields.

deepCompareFields

public boolean deepCompareFields(java.lang.Object other,
                                 EqualityHelper helper)
Returns true if all the fields of this instance are deep equal to the corresponding fields of the specified Employee.

Specified by:
deepCompareFields in interface DeepEquality
Overrides:
deepCompareFields in class Person
Parameters:
other - the object with which to compare.
helper - EqualityHelper to keep track of instances that have already been processed.
Returns:
true if all the fields are deep equal; false otherwise.
Throws:
java.lang.ClassCastException - if the specified instances' type prevents it from being compared to this instance.


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.