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

java.lang.Object
  extended byorg.apache.jdo.tck.pc.company.Project
All Implemented Interfaces:
java.lang.Comparable, DeepEquality, java.io.Serializable

public class Project
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable, DeepEquality

This class represents a project, a budgeted task with one or more employees working on it.

See Also:
Serialized Form

Nested Class Summary
static class Project.Oid
          This class is used to represent the application identity for the Project class.
 
Constructor Summary
protected Project()
          This is the JDO-required no-args constructor.
  Project(long projid, java.lang.String name, java.math.BigDecimal budget)
          Initialize a project.
 
Method Summary
 void addMember(Employee emp)
          Add a new member to the project.
 void addReviewer(Employee emp)
          Add a reviewer to the project.
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 int compareTo(Project other)
          Compares this object with the specified Project object for order.
 boolean deepCompareFields(DeepEquality other, EqualityHelper helper)
          Returns true if all the fields of this instance are deep equal to the coresponding fields of the specified Person.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.math.BigDecimal getBudget()
          Get the project's budget.
 java.util.Set getMembers()
          Get the project members.
 java.lang.String getName()
          Get the name of the project.
 long getProjid()
          Get the project ID.
 java.util.Set getReviewers()
          Get the reviewers associated with this project.
 int hashCode()
          Returns a hash code value for the object.
 void removeMember(Employee emp)
          Remove a member from the project.
 void removeReviewer(Employee emp)
          Remove a reviewer from the project.
 void setBudget(java.math.BigDecimal budget)
          Set the project's budget.
 void setMembers(java.util.Set employees)
          Set the members of the project.
 void setName(java.lang.String name)
          Set the name of the project.
 void setReviewers(java.util.Set reviewers)
          Set the reviewers associated with this project.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project

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


Project

public Project(long projid,
               java.lang.String name,
               java.math.BigDecimal budget)
Initialize a project.

Parameters:
projid - The project identifier.
name - The name of the project.
budget - The budget for the project.
Method Detail

getProjid

public long getProjid()
Get the project ID.

Returns:
The project ID.

getName

public java.lang.String getName()
Get the name of the project.

Returns:
The name of the project.

setName

public void setName(java.lang.String name)
Set the name of the project.

Parameters:
name - The name of the project.

getBudget

public java.math.BigDecimal getBudget()
Get the project's budget.

Returns:
The project's budget.

setBudget

public void setBudget(java.math.BigDecimal budget)
Set the project's budget.

Parameters:
budget - The project's budget.

getReviewers

public java.util.Set getReviewers()
Get the reviewers associated with this project.


addReviewer

public void addReviewer(Employee emp)
Add a reviewer to the project.

Parameters:
emp - The employee to add as a reviewer.

removeReviewer

public void removeReviewer(Employee emp)
Remove a reviewer from the project.

Parameters:
emp - The employee to remove as a reviewer of this project.

setReviewers

public void setReviewers(java.util.Set reviewers)
Set the reviewers associated with this project.

Parameters:
reviewers - The set of reviewers to associate with this project.

getMembers

public java.util.Set getMembers()
Get the project members.

Returns:
The members of the project is returned as an unmodifiable set of Employees.

addMember

public void addMember(Employee emp)
Add a new member to the project.

Parameters:
emp - The employee to add to the project.

removeMember

public void removeMember(Employee emp)
Remove a member from the project.

Parameters:
emp - The employee to remove from the project.

setMembers

public void setMembers(java.util.Set employees)
Set the members of the project.

Parameters:
employees - The set of employees to be the members of this project.

deepCompareFields

public boolean deepCompareFields(DeepEquality other,
                                 EqualityHelper helper)
Returns true if all the fields of this instance are deep equal to the coresponding fields of the specified Person.

Specified by:
deepCompareFields in interface DeepEquality
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.

compareTo

public int compareTo(java.lang.Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
java.lang.ClassCastException - - if the specified object's type prevents it from being compared to this Object.

compareTo

public int compareTo(Project other)
Compares this object with the specified Project object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Parameters:
other - The Project object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified Project object.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Parameters:
obj - the object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object.

Returns:
a hash code value for this object.


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