|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.tck.pc.company.Company
This class represents information about a company.
Nested Class Summary | |
static class |
Company.Oid
The class to be used as the application identifier for the Company class. |
Field Summary | |
protected static java.text.SimpleDateFormat |
formatter
|
Constructor Summary | |
Company()
This is the JDO-required no-args constructor. |
|
Company(long companyid,
java.lang.String name,
java.util.Date founded)
Initialize the Company instance. |
|
Company(long companyid,
java.lang.String name,
java.util.Date founded,
IAddress addr)
Initialize the Company instance. |
Method Summary | |
void |
addDepartment(Department dept)
Add a Department instance to the company. |
static int |
compare(ICompany o1,
ICompany o2)
Compares its two ICompany arguments for order. |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compare two instances. |
int |
compareTo(ICompany other)
Compares this object with the specified Company 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 specified Person. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
IAddress |
getAddress()
Get the address of the company. |
long |
getCompanyid()
Get the company id. |
java.util.Set |
getDepartments()
Get the departments contained in the company. |
protected java.lang.String |
getFieldRepr()
Returns a String representation of the non-relationship fields. |
java.util.Date |
getFounded()
Get the date that the company was founded. |
java.lang.String |
getName()
Get the name of the company. |
int |
hashCode()
Returns a hash code value for the object. |
void |
removeDepartment(Department dept)
Remove a Department instance from the company. |
void |
setAddress(IAddress address)
Set the primary address for the company. |
void |
setCompanyid(long id)
Set the id associated with this object. |
void |
setDepartments(java.util.Set departments)
Initialize the set of Department s in the company to the
parameter. |
void |
setFounded(java.util.Date founded)
Set the date that the company was founded. |
void |
setName(java.lang.String name)
Set the name of the company. |
java.lang.String |
toString()
Returns a String representation of a Company object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static java.text.SimpleDateFormat formatter
Constructor Detail |
public Company()
public Company(long companyid, java.lang.String name, java.util.Date founded)
Company
instance.
companyid
- The company id.name
- The company name.founded
- The date the company was founded.public Company(long companyid, java.lang.String name, java.util.Date founded, IAddress addr)
Company
instance.
companyid
- The company id.name
- The company name.founded
- The date the company was founded.addr
- The company's address.Method Detail |
public long getCompanyid()
getCompanyid
in interface ICompany
public void setCompanyid(long id)
setCompanyid
in interface ICompany
id
- the id.public java.lang.String getName()
getName
in interface ICompany
public void setName(java.lang.String name)
setName
in interface ICompany
name
- The value to use for the name of the company.public java.util.Date getFounded()
getFounded
in interface ICompany
public void setFounded(java.util.Date founded)
setFounded
in interface ICompany
founded
- The date to set that the company was founded.public IAddress getAddress()
getAddress
in interface ICompany
public void setAddress(IAddress address)
setAddress
in interface ICompany
address
- The address to set for the company.public java.util.Set getDepartments()
getDepartments
in interface ICompany
Set
that contains all the
Department
s of the company.public void addDepartment(Department dept)
Department
instance to the company.
dept
- The Department
instance to add.public void removeDepartment(Department dept)
Department
instance from the company.
dept
- The Department
instance to remove.public void setDepartments(java.util.Set departments)
Department
s in the company to the
parameter.
setDepartments
in interface ICompany
departments
- The set of Department
s for the
company.public java.lang.String toString()
Company
object.
Company
object.protected java.lang.String getFieldRepr()
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 specified Person.
deepCompareFields
in interface DeepEquality
other
- 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 int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- 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.Comparator
public int compareTo(ICompany other)
other
- The Company object to be compared.
public static int compare(ICompany o1, ICompany o2)
o1
- the first ICompany object to be compared.o2
- the second ICompany object to be compared.
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Comparator
obj
- 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 |