orderprocessing
Class Address

java.lang.Object
  extended byorderprocessing.Address
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

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

This class maintains information for an address

 History
 date		description
 -----		-----------
 11/12/99	Creation, break out from customer class
 
This class represents addresses, usually customer addresses. It is useful only for addresses in the U.S. however.

See Also:
Serialized Form

Constructor Summary
Address(java.lang.String all, java.lang.String separator)
          Create an address from a single encoded string
Address(java.lang.String name, java.lang.String street, java.lang.String city, java.lang.String state, java.lang.String zip)
          Create an address from a set of strings representing the parts of the address
 
Method Summary
 java.lang.String city()
          Retrieve the name of the city
 void city(java.lang.String city)
          Change the city associated with this address
 java.lang.Object clone()
           
 void display()
          Display this address info on standard output
 boolean equals(java.lang.Object other)
           
 int hashCode()
           
 java.lang.String name()
          Retrieve the name associated with this address
 void name(java.lang.String name)
          Change the name associated with this address
 java.lang.String state()
          Retrieve the state's two character code
 void state(java.lang.String state)
          Change the state for this address
 java.lang.String street()
          Retrieve the number and street for this address
 void street(java.lang.String street)
          Change the number and street of this address
 java.lang.String toString()
           
 java.lang.String zip()
          retrieve the postal (zip) code for this address
 void zip(java.lang.String zip)
          Change the zip code for this address
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Address

public Address(java.lang.String name,
               java.lang.String street,
               java.lang.String city,
               java.lang.String state,
               java.lang.String zip)
Create an address from a set of strings representing the parts of the address

Parameters:
name - the customer name
street - the street address of the customer
city - the city of the customer
state - the state (US) of the customer
zip - the zip code of the customer

Address

public Address(java.lang.String all,
               java.lang.String separator)
Create an address from a single encoded string

Parameters:
all - the complete address of the customer beginning with the name
separator - the separator character between fields of all
Method Detail

clone

public java.lang.Object clone()

equals

public boolean equals(java.lang.Object other)

hashCode

public int hashCode()

display

public void display()
Display this address info on standard output


name

public java.lang.String name()
Retrieve the name associated with this address

Returns:
the name

street

public java.lang.String street()
Retrieve the number and street for this address

Returns:
the number and street

city

public java.lang.String city()
Retrieve the name of the city

Returns:
the city

state

public java.lang.String state()
Retrieve the state's two character code

Returns:
the state's code TODO guarantee that it returns a legal code

zip

public java.lang.String zip()
retrieve the postal (zip) code for this address

Returns:
the zip code

name

public void name(java.lang.String name)
Change the name associated with this address

Parameters:
name - the new name

street

public void street(java.lang.String street)
Change the number and street of this address

Parameters:
street - the number and street

city

public void city(java.lang.String city)
Change the city associated with this address

Parameters:
city - the new city

state

public void state(java.lang.String state)
Change the state for this address

Parameters:
state - the two character code for this addreas.

zip

public void zip(java.lang.String zip)
Change the zip code for this address

Parameters:
zip - the new zip code

toString

public java.lang.String toString()