|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jdo.tck.pc.company.Department
This class represents a department within a company.
| Nested Class Summary | |
static class |
Department.Oid
The application identity class associated with the Department class. |
| Field Summary | |
static int |
RECOMMENDED_NO_OF_EMPS
|
| Constructor Summary | |
Department()
This is the JDO-required no-args constructor. |
|
Department(long deptid,
java.lang.String name)
Construct a Department instance. |
|
Department(long deptid,
java.lang.String name,
ICompany company)
Construct a Department instance. |
|
Department(long deptid,
java.lang.String name,
ICompany company,
IEmployee employeeOfTheMonth)
Construct a Department instance. |
|
| Method Summary | |
void |
addEmployee(Employee emp)
Add an employee to the department. |
void |
addFundedEmp(Employee emp)
Add an employee to the collection of funded employees of this department. |
static int |
compare(IDepartment o1,
IDepartment o2)
Compares its two IDepartment arguments for order. |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compare two instances. |
int |
compareTo(IDepartment other)
Compares this object with the specified Department object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
deepCompareFields(java.lang.Object other,
EqualityHelper helper)
Returns true if all the fields of this instance are
deep equal to the coresponding fields of the other Department. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
ICompany |
getCompany()
Get the company associated with the department. |
long |
getDeptid()
Get the department id. |
IEmployee |
getEmployeeOfTheMonth()
Get the employee of the month associated with the department. |
java.util.Set |
getEmployees()
Get the employees in the department as an unmodifiable set. |
protected java.lang.String |
getFieldRepr()
Returns a String representation of the non-relationship fields. |
java.util.Set |
getFundedEmps()
Get the funded employees in the department as an unmodifiable set. |
java.lang.String |
getName()
Get the name of the department. |
int |
hashCode()
Returns a hash code value for the object. |
void |
removeEmployee(Employee emp)
Remove an employee from the department. |
void |
removeFundedEmp(Employee emp)
Remove an employee from collection of funded employees of this department. |
void |
setCompany(ICompany company)
Set the company for the department. |
void |
setDeptid(long id)
Set the id associated with this object. |
void |
setEmployeeOfTheMonth(IEmployee employeeOfTheMonth)
Set the employee of the month for the department. |
void |
setEmployees(java.util.Set employees)
Set the employees to be in this department. |
void |
setFundedEmps(java.util.Set employees)
Set the funded employees to be in this department. |
void |
setName(java.lang.String name)
Set the name of the department. |
java.lang.String |
toString()
Returns a String representation of a Department object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int RECOMMENDED_NO_OF_EMPS
| Constructor Detail |
public Department()
public Department(long deptid,
java.lang.String name)
Department instance.
deptid - The department id.name - The name of the department.
public Department(long deptid,
java.lang.String name,
ICompany company)
Department instance.
deptid - The department id.name - The name of the department.company - The company that the department is associated with.
public Department(long deptid,
java.lang.String name,
ICompany company,
IEmployee employeeOfTheMonth)
Department instance.
deptid - The department id.name - The name of the department.company - The company that the department is associated with.employeeOfTheMonth - The employee of the month the
department is associated with.| Method Detail |
public void setDeptid(long id)
setDeptid in interface IDepartmentid - the id.public long getDeptid()
getDeptid in interface IDepartmentpublic java.lang.String getName()
getName in interface IDepartmentpublic void setName(java.lang.String name)
setName in interface IDepartmentname - The name to set for the department.public ICompany getCompany()
getCompany in interface IDepartmentpublic void setCompany(ICompany company)
setCompany in interface IDepartmentcompany - The company to associate with the department.public IEmployee getEmployeeOfTheMonth()
getEmployeeOfTheMonth in interface IDepartmentpublic void setEmployeeOfTheMonth(IEmployee employeeOfTheMonth)
setEmployeeOfTheMonth in interface IDepartmentemployeeOfTheMonth - The employee of the month to
associate with the department.public java.util.Set getEmployees()
getEmployees in interface IDepartmentpublic void addEmployee(Employee emp)
emp - The employee to add to the department.public void removeEmployee(Employee emp)
emp - The employee to remove from the department.public void setEmployees(java.util.Set employees)
setEmployees in interface IDepartmentemployees - The set of employees for this department.public java.util.Set getFundedEmps()
getFundedEmps in interface IDepartmentpublic void addFundedEmp(Employee emp)
emp - The employee to add to the department.public void removeFundedEmp(Employee emp)
emp - The employee to remove from the department.public void setFundedEmps(java.util.Set employees)
setFundedEmps in interface IDepartmentemployees - The set of funded employees for this department.
public boolean deepCompareFields(java.lang.Object other,
EqualityHelper helper)
true if all the fields of this instance are
deep equal to the coresponding fields of the other Department.
deepCompareFields in interface DeepEqualityother - the object with which to compare.helper - EqualityHelper to keep track of instances that have
already been processed.
true if all the fields are deep equal;
false otherwise.
java.lang.ClassCastException - if the specified instances' type prevents
it from being compared to this instance.public java.lang.String toString()
Department object.
Department object.protected java.lang.String getFieldRepr()
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - The Object to be compared.
java.lang.ClassCastException - - if the specified object's type prevents
it from being compared to this Object.
public int compare(java.lang.Object o1,
java.lang.Object o2)
compare in interface java.util.Comparatorpublic int compareTo(IDepartment other)
other - The Department object to be compared.
public static int compare(IDepartment o1,
IDepartment o2)
o1 - the first IDepartment object to be compared.o2 - the second IDepartment object to be compared.
public boolean equals(java.lang.Object obj)
equals in interface java.util.Comparatorobj - the object with which to compare.
true if this object is the same as the obj
argument; false otherwise.public int hashCode()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||