ps6
Class Address

java.lang.Object
  extended by ps6.Address

public class Address
extends Object

An Address is an immutable record type defining a location.

Specification Fields

Constructor Summary
Address(int num, String name, String zipcode)
          Address Constructor
 
Method Summary
 boolean equals(Address other)
           
 boolean equals(Object other)
           
 String getName()
          Get the name of the street
 int getNum()
          Get the street number
 String getZipcode()
          Get the zipcode for the street
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Address

public Address(int num,
               String name,
               String zipcode)
Address Constructor

Requires:
num > 0 && name != null && zipcode != null
Effects:
returns an Address with the given field values
Method Detail

getNum

public int getNum()
Get the street number

Returns:
this.num

getName

public String getName()
Get the name of the street

Returns:
this.name

getZipcode

public String getZipcode()
Get the zipcode for the street

Returns:
this.zipcode

equals

public boolean equals(Object other)
Overrides:
equals in class Object

equals

public boolean equals(Address other)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object
Returns:
a String representation of this address in the format: "num name zipcode"