org.ahmadsoft.postal
Class PostalCodeEntry

java.lang.Object
  extended by org.ahmadsoft.postal.PostalCodeEntry

public class PostalCodeEntry
extends java.lang.Object

Represents a USPS recognized city, state, postal code combination. Instances of this class are immutable.

Author:
Amin Ahmad

Constructor Summary
PostalCodeEntry(int postalCode, java.lang.String city, java.lang.String state, int type)
          Constructs a new postal code entry.
 
Method Summary
 java.lang.String getCity()
          Returns the city associated with this entry.
 int getEntryType()
          Returns the type of this entry.
 int getPostalCode()
          Returns the postal code associated with this entry.
 java.lang.String getState()
          Returns the two-letter abbreviation for the state associated with this entry.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PostalCodeEntry

public PostalCodeEntry(int postalCode,
                       java.lang.String city,
                       java.lang.String state,
                       int type)
Constructs a new postal code entry.

Parameters:
postalCode - the postal code.
city - the city name.
state - the state.
type - the type of entry.
Method Detail

getCity

public java.lang.String getCity()
Returns the city associated with this entry.

Returns:
the city associated with this entry.

getEntryType

public int getEntryType()
Returns the type of this entry. PostalCodeConstants.CITY* fully enumerates the valid values for this entry.

Returns:
the type of this entry.

getPostalCode

public int getPostalCode()
Returns the postal code associated with this entry.

Returns:
the postal code associated with this entry.

getState

public java.lang.String getState()
Returns the two-letter abbreviation for the state associated with this entry. All valid two-letter abbreviations are enumerated in Official USPS Abbreviations.

Returns:
the two-letter abbreviation for the state associated with this entry.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006-2009 Ahmadsoft. All Rights Reserved.