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

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

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

This class represents a postal address.

See Also:
Serialized Form

Nested Class Summary
static class Address.Oid
          This class is used to represent the application identifier for the Address class.
 
Constructor Summary
protected Address()
          This is the JDO-required no-args constructor
  Address(long addrid, java.lang.String street, java.lang.String city, java.lang.String state, java.lang.String zipcode, java.lang.String country)
          This constructor initializes the Address components.
 
Method Summary
 int compareTo(Address other)
          Compares this object with the specified Address object for order.
 int compareTo(java.lang.Object o)
          Compares this object with the specified 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.
 long getAddrid()
          Get the addrid associated with this object.
 java.lang.String getCity(java.lang.String city)
          Get the city.
 java.lang.String getCountry()
          Get the country component of the address.
 java.lang.String getState()
          Get the state component of the address.
 java.lang.String getStreet()
          Get the street component of the address.
 java.lang.String getZipcode()
          Get the zipcode component of the address.
 int hashCode()
          Returns a hash code value for the object.
 void setCity(java.lang.String city)
          Set the city component of the address.
 void setCountry(java.lang.String country)
          Set the country component of the address.
 void setState(java.lang.String state)
          Set the state component of the address.
 void setStreet(java.lang.String street)
          Set the street component of the address.
 void setZipcode(java.lang.String zipcode)
          Set the zip code component of the address.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Address

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


Address

public Address(long addrid,
               java.lang.String street,
               java.lang.String city,
               java.lang.String state,
               java.lang.String zipcode,
               java.lang.String country)
This constructor initializes the Address components.

Parameters:
addrid - The address ID.
street - The street address.
city - The city.
state - The state.
zipcode - The zip code.
country - The zip country.
Method Detail

getAddrid

public long getAddrid()
Get the addrid associated with this object.

Returns:
the addrid.

getStreet

public java.lang.String getStreet()
Get the street component of the address.

Returns:
The street component of the address.

setStreet

public void setStreet(java.lang.String street)
Set the street component of the address.

Parameters:
street - The street component.

getCity

public java.lang.String getCity(java.lang.String city)
Get the city.

Returns:
The city component of the address.

setCity

public void setCity(java.lang.String city)
Set the city component of the address.

Parameters:
city - The city.

getState

public java.lang.String getState()
Get the state component of the address.

Returns:
The state.

setState

public void setState(java.lang.String state)
Set the state component of the address.

Parameters:
state - The state.

getZipcode

public java.lang.String getZipcode()
Get the zipcode component of the address.

Returns:
The zipcode.

setZipcode

public void setZipcode(java.lang.String zipcode)
Set the zip code component of the address.

Parameters:
zipcode - The zipcode.

getCountry

public java.lang.String getCountry()
Get the country component of the address.

Returns:
The country.

setCountry

public void setCountry(java.lang.String country)
Set the country component of the address.

Parameters:
country - The country.

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(Address other)
Compares this object with the specified Address 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 Address 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 Address 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 Apache Software Foundation. All Rights Reserved.