|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--campus.compass.ZipCodeSource
Given a zip code, determine associated city/state, or vice versa.
Field Summary | |
protected static java.util.Hashtable |
_region
|
static java.util.Hashtable |
_state
|
protected static java.util.Hashtable |
_zipcode
|
Constructor Summary | |
ZipCodeSource()
|
Method Summary | |
private static java.lang.String |
decodeCity(java.lang.String region)
Decode city from region represtation. |
private static java.lang.String |
decodeState(java.lang.String region)
Decode state from region represtation. |
private static java.lang.String |
encodeRegion(java.lang.String city,
java.lang.String state)
Encode city and state into region representation. |
static java.lang.String |
getCity(java.lang.String zipcode)
Return the city for specified zipcode. |
static java.lang.String |
getRegion(java.lang.String zipcode)
Return the region (city and state) for specified zipcode. |
static java.lang.String |
getState(java.lang.String zipcode)
Return the state for specified zipcode. |
static java.lang.String |
getStateAbbr(java.lang.String name)
Get abbr name of a state for specified full name. |
static java.lang.String |
getStateName(java.lang.String abbr)
Get full name of a state for specified abbreviation. |
static java.lang.String |
getZipCode(java.lang.String city,
java.lang.String state)
Return the zipcode for specified region (city and state). |
private static void |
initStateMapping()
Init state name to abbrev mapping. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.util.Hashtable _state
protected static java.util.Hashtable _region
protected static java.util.Hashtable _zipcode
Constructor Detail |
public ZipCodeSource()
Method Detail |
public static java.lang.String getZipCode(java.lang.String city, java.lang.String state) throws java.lang.Exception
java.lang.Exception
public static java.lang.String getRegion(java.lang.String zipcode) throws java.lang.Exception
java.lang.Exception
public static java.lang.String getCity(java.lang.String zipcode) throws java.lang.Exception
java.lang.Exception
public static java.lang.String getState(java.lang.String zipcode) throws java.lang.Exception
java.lang.Exception
private static java.lang.String encodeRegion(java.lang.String city, java.lang.String state)
private static java.lang.String decodeCity(java.lang.String region)
private static java.lang.String decodeState(java.lang.String region)
public static java.lang.String getStateName(java.lang.String abbr)
public static java.lang.String getStateAbbr(java.lang.String name)
private static void initStateMapping()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |