|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.location.AddressInfo
public class AddressInfo
The AddressInfo class holds textual address information about a location. Typically the information is e.g. street address. The information is divided into fields (e.g. street, postal code, city, etc.). Defined field constants can be used to retrieve field data.
If the value of a field is not available, it is set to null.
The names of the fields use terms and definitions that are commonly used e.g. in the United States. Addresses for other countries should map these to the closest corresponding entities used in that country.
This class is only a container for the information. The getField method returns the value set for the defined field using the setField method. When the platform implementation returns AddressInfo objects, it MUST ensure that it only returns objects where the parameters have values set as described for their semantics in this class.
NOTE: The fields are identified using integers that have constant definitions in this class. The EG has considered also an alternative of using strings to identify the field, potentially providing easier extensibility (for private extensions). Currently the conclusion is to use integers.
Below are some typical examples of addresses in different countries and how they map to the AddressInfo fields.
AddressInfo Field | American Example | British Example |
EXTENSION | Flat 5 | The Oaks |
STREET | 10 Washington Street | 20 Greenford Court |
POSTAL_CODE | 12345 | AB1 9YZ |
CITY | Palo Alto | Cambridge |
COUNTY | Santa Clara County | Cambridgeshire |
STATE | California | England |
COUNTRY | United States of America | United Kingdom |
COUNTRY_CODE | US | GB |
DISTRICT | ||
BUILDING_NAME | ||
BUILDING_FLOOR | ||
BUILDING_ROOM | ||
BUILDING_ZONE | ||
CROSSING1 | ||
CROSSING2 | ||
URL | http://www.americanurl.com | http://britishurl.co.uk |
PHONE_NUMBER |
Field Summary | ||
---|---|---|
static int |
BUILDING_FLOOR
Address field denoting building floor. |
|
static int |
BUILDING_NAME
Address field denoting building name. |
|
static int |
BUILDING_ROOM
Address field denoting building room. |
|
static int |
BUILDING_ZONE
Address field denoting a building zone |
|
static int |
CITY
Address field denoting town or city name. |
|
static int |
COUNTRY
Address field denoting country. |
|
static int |
COUNTRY_CODE
Address field denoting country as a two-letter ISO 3166-1 code. |
|
static int |
COUNTY
Address field denoting a county, which is an entity between a state and a city |
|
static int |
CROSSING1
Address field denoting a street in a crossing. |
|
static int |
CROSSING2
Address field denoting a street in a crossing. |
|
static int |
DISTRICT
Address field denoting a municipal district. |
|
static int |
EXTENSION
Address field denoting address extension, e.g. flat number. |
|
static int |
PHONE_NUMBER
Address field denoting a phone number for this place |
|
static int |
POSTAL_CODE
Address field denoting zip or postal code. |
|
static int |
STATE
Address field denoting state or province. |
|
static int |
STREET
Address field denoting street name and number. |
|
static int |
URL
Address field denoting a URL for this place. |
Constructor Summary | ||
---|---|---|
AddressInfo()
|
Method Summary | ||
---|---|---|
String |
getField(int field)
Returns the value of an address field. |
|
void |
setField(int field,
String value)
Sets the value of an address field. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int EXTENSION
public static final int STREET
public static final int POSTAL_CODE
public static final int CITY
public static final int COUNTY
public static final int STATE
public static final int COUNTRY
public static final int COUNTRY_CODE
public static final int DISTRICT
public static final int BUILDING_NAME
public static final int BUILDING_FLOOR
public static final int BUILDING_ROOM
public static final int BUILDING_ZONE
public static final int CROSSING1
public static final int CROSSING2
public static final int URL
public static final int PHONE_NUMBER
Constructor Detail |
---|
public AddressInfo()
Method Detail |
---|
public String getField(int field)
Returns the value of an address field. If the field is not available null is returned.
Example: getField(AddressInfo.STREET) might return "113 Broadway" if the location is on Broadway, New York, or null if not available.
field
- the ID of the field to be retrieved
IllegalArgumentException
- if the parameter field ID is not one of the constant values defined in this classAddressInfo.setField(int, String)
public void setField(int field, String value)
Sets the value of an address field.
field
- the ID of the field to be setvalue
- the new value for the field. null is used to indicate that the field has no content.
IllegalArgumentException
- if the parameter field ID is not one of the constant values defined in this classAddressInfo.getField(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal