net.rim.device.api.lbs.maps.model
Class MapLocation

java.lang.Object
  extended by net.rim.device.api.lbs.maps.model.AbstractMappable
      extended by net.rim.device.api.lbs.maps.model.MapPoint
          extended by net.rim.device.api.lbs.maps.model.MapMarker
              extended by net.rim.device.api.lbs.maps.model.geospatial.GsMarker
                  extended by net.rim.device.api.lbs.maps.model.MapLocation
All Implemented Interfaces:
Comparable, Boxable, GsElement, Mappable, Persistable

public class MapLocation
extends GsMarker
implements Persistable

Represents a mappable location that includes the latitude, longitude, label and description of the location. You can also use the MapLocation class to store additional information about the location. The type of information stored in a MapLocation represents a certain 'type' of location. For example, a point of interest location (a business) might have more information about the location, whereas a basic location might have less information. The additional information is stored in the form of a (key, value) pair, where the key can be a pre-defined string token defined in this class or in any object that you specify. The key must not conflict with the predefined set of keys that are already saved for this location.

Since:
BlackBerry API 6.0.0

Field Summary
static String LBS_DISTANCE_FROM_POI_CENTER_KEY
          A data key to specify the distance between a given point of interest (POI) location and the center of the region containing that POI location.
static String LBS_DISTANCE_FROM_POI_CENTRE_KEY
          Deprecated. Use MapLocation.LBS_DISTANCE_FROM_POI_CENTER_KEY instead
static String LBS_LOCATION_CATEGORIES_KEY
          A data key to specify the location's categories.
static String LBS_LOCATION_CITY_KEY
          A data key to specify the location's city.
static String LBS_LOCATION_COUNTRY_KEY
          A data key to specify the location's country.
static String LBS_LOCATION_COUNTY_KEY
          A data key to specify the location's county.
static String LBS_LOCATION_DISTRICT_KEY
          A data key to specify the location's district.
static String LBS_LOCATION_EMAIL_KEY
          A data key to specify the location's email address.
static String LBS_LOCATION_FAX_KEY
          A data key to specify the location's fax number.
static String LBS_LOCATION_ISO_ALPHA_2_COUNTRY_CODE
          A data key to specify the 2 character ISO 3166-1 country code.
static String LBS_LOCATION_ISO_ALPHA_3_COUNTRY_CODE
          A data key to specify the 3 character ISO 3166-1 country code.
static String LBS_LOCATION_ISO_COUNTRY_ID
          A data key to specify the ISO 3166-1 country id.
static String LBS_LOCATION_MCC
          A data key to specify the mcc.
static String LBS_LOCATION_PHONE_KEY
          A data key to specify the location's phone number.
static String LBS_LOCATION_POSTAL_CODE_KEY
          A data key to specify the location's postal code or zip code.
static String LBS_LOCATION_RATING_KEY
          A data key to specify the location's rating.
static String LBS_LOCATION_REGION_KEY
          A data key to specify the location's region (for example, province).
static String LBS_LOCATION_REVIEW_KEY
          A data key to specify the location's review.
static String LBS_LOCATION_STREET_ADDRESS_KEY
          A data key to specify the location's street address.
static String LBS_LOCATION_TIME_ZONE
          A data key to specify the time zone id.
static String LBS_LOCATION_URL_KEY
          A data key to specify the location's URL.
static String LBS_POI_LOCATION_FOLDER_HIERARCHY_KEY
          A data key to specify the hierarchy of the location's folder.
static String LBS_POI_LOCATION_MERIT_KEY
          A data key to specify the location's merit.
static String LBS_POI_LOCATION_SOURCE_KEY
          A data key to specify the location's source.
static String LBS_POI_LOCATION_SPONSORED_KEY
          A data key to specify the location's sponsor.
static String LBS_ZOOM_HINT
          A data key to specify a zoom hint for the location.
 
Constructor Summary
MapLocation()
          Constructs a new MapLocation instance.
MapLocation(double lat, double lon, String label, String description)
          Constructs a new MapLocation instance using the latitude, longitude, name and description of the location.
MapLocation(MapPoint mapPoint, String label, String description)
          Constructs a new MapLocation instance using the coordinates, label, and description of the location.
 
Method Summary
 void addData(Object key, Object value)
          Adds additional data to this location object.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 Object getData(Object key)
          Retrieves existing data for a specified key.
 Enumeration getDataKeys()
          Retrieves an enumeration of the data keys in this Location object.
 int hashCode()
          Returns a hash code value for the object.
 void removeData(Object key)
          Removes existing data for a specific key.
 String toString()
          Generates the string representation for this Location object.
 
Methods inherited from class net.rim.device.api.lbs.maps.model.geospatial.GsMarker
equalsHierarchically, equalsNode, getDescription, getName, getParent, setDescription, setName, setParent
 
Methods inherited from class net.rim.device.api.lbs.maps.model.MapMarker
getAnchorOffset, getIconUri, setAnchorOffset, setIconUri
 
Methods inherited from class net.rim.device.api.lbs.maps.model.MapPoint
compareTo, getBoundingBox, getLat, getLon, setLat, setLon, toCoordinates, updateBoundingBox
 
Methods inherited from class net.rim.device.api.lbs.maps.model.AbstractMappable
getCommandsByType, getStyleId, isClusterable, match, setStyleId
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.rim.device.api.lbs.maps.model.Mappable
getStyleId, isClusterable
 
Methods inherited from interface net.rim.device.api.lbs.maps.Boxable
getBoundingBox
 



Field Detail

LBS_LOCATION_STREET_ADDRESS_KEY

public static final String LBS_LOCATION_STREET_ADDRESS_KEY
A data key to specify the location's street address.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_CITY_KEY

public static final String LBS_LOCATION_CITY_KEY
A data key to specify the location's city.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_REGION_KEY

public static final String LBS_LOCATION_REGION_KEY
A data key to specify the location's region (for example, province).

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_COUNTY_KEY

public static final String LBS_LOCATION_COUNTY_KEY
A data key to specify the location's county.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_DISTRICT_KEY

public static final String LBS_LOCATION_DISTRICT_KEY
A data key to specify the location's district.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_COUNTRY_KEY

public static final String LBS_LOCATION_COUNTRY_KEY
A data key to specify the location's country.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_POSTAL_CODE_KEY

public static final String LBS_LOCATION_POSTAL_CODE_KEY
A data key to specify the location's postal code or zip code.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_PHONE_KEY

public static final String LBS_LOCATION_PHONE_KEY
A data key to specify the location's phone number.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_FAX_KEY

public static final String LBS_LOCATION_FAX_KEY
A data key to specify the location's fax number.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_URL_KEY

public static final String LBS_LOCATION_URL_KEY
A data key to specify the location's URL.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_EMAIL_KEY

public static final String LBS_LOCATION_EMAIL_KEY
A data key to specify the location's email address.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_CATEGORIES_KEY

public static final String LBS_LOCATION_CATEGORIES_KEY
A data key to specify the location's categories.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_REVIEW_KEY

public static final String LBS_LOCATION_REVIEW_KEY
A data key to specify the location's review.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_RATING_KEY

public static final String LBS_LOCATION_RATING_KEY
A data key to specify the location's rating.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_POI_LOCATION_SPONSORED_KEY

public static final String LBS_POI_LOCATION_SPONSORED_KEY
A data key to specify the location's sponsor.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_POI_LOCATION_SOURCE_KEY

public static final String LBS_POI_LOCATION_SOURCE_KEY
A data key to specify the location's source.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_POI_LOCATION_FOLDER_HIERARCHY_KEY

public static final String LBS_POI_LOCATION_FOLDER_HIERARCHY_KEY
A data key to specify the hierarchy of the location's folder.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_POI_LOCATION_MERIT_KEY

public static final String LBS_POI_LOCATION_MERIT_KEY
A data key to specify the location's merit.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_DISTANCE_FROM_POI_CENTER_KEY

public static final String LBS_DISTANCE_FROM_POI_CENTER_KEY
A data key to specify the distance between a given point of interest (POI) location and the center of the region containing that POI location.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

LBS_DISTANCE_FROM_POI_CENTRE_KEY

public static final String LBS_DISTANCE_FROM_POI_CENTRE_KEY
Deprecated. Use MapLocation.LBS_DISTANCE_FROM_POI_CENTER_KEY instead
See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_ZOOM_HINT

public static final String LBS_ZOOM_HINT
A data key to specify a zoom hint for the location.

See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

LBS_LOCATION_MCC

public static final String LBS_LOCATION_MCC
A data key to specify the mcc.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

LBS_LOCATION_TIME_ZONE

public static final String LBS_LOCATION_TIME_ZONE
A data key to specify the time zone id.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

LBS_LOCATION_ISO_ALPHA_2_COUNTRY_CODE

public static final String LBS_LOCATION_ISO_ALPHA_2_COUNTRY_CODE
A data key to specify the 2 character ISO 3166-1 country code.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

LBS_LOCATION_ISO_ALPHA_3_COUNTRY_CODE

public static final String LBS_LOCATION_ISO_ALPHA_3_COUNTRY_CODE
A data key to specify the 3 character ISO 3166-1 country code.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

LBS_LOCATION_ISO_COUNTRY_ID

public static final String LBS_LOCATION_ISO_COUNTRY_ID
A data key to specify the ISO 3166-1 country id.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0


Constructor Detail

MapLocation

public MapLocation()
Constructs a new MapLocation instance.

Since:
BlackBerry API 6.0.0

MapLocation

public MapLocation(MapPoint mapPoint,
                   String label,
                   String description)
Constructs a new MapLocation instance using the coordinates, label, and description of the location.

Parameters:
mapPoint - The coordinates of the location.
label - The label of the location.
description - The description of the location.
Since:
BlackBerry API 6.0.0

MapLocation

public MapLocation(double lat,
                   double lon,
                   String label,
                   String description)
Constructs a new MapLocation instance using the latitude, longitude, name and description of the location.

Parameters:
lat - The latitude of the location (in degrees).
lon - The longitude of the location (in degrees).
label - The location name (for example, RIM head office).
description - The description of the location (for example, work place).
Since:
BlackBerry API 6.0.0


Method Detail

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class GsMarker
Returns:
a hash code value for this object.
See Also:
Object.hashCode()
Since:
BlackBerry API 6.0.0

equals

public boolean equals(Object obj)
Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).

Overrides:
equals in class GsMarker
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.equals(Object)
Since:
BlackBerry API 6.0.0

addData

public void addData(Object key,
                    Object value)
Adds additional data to this location object. The data (for instance, the value) can be anything and the data is always added under a given key object which can also be anything. Adding in this context includes modifying existing data (for instance, if the data is already present for that key).

Overrides:
addData in class MapPoint
Parameters:
key - The key supplied by the caller.
value - The value to store (under the supplied key).
Since:
BlackBerry API 6.0.0

getDataKeys

public Enumeration getDataKeys()
Retrieves an enumeration of the data keys in this Location object.

Overrides:
getDataKeys in class MapPoint
Returns:
The enumeration containing all keys used to retrieve data from this Location object.
Since:
BlackBerry API 6.0.0

removeData

public void removeData(Object key)
Removes existing data for a specific key.

Overrides:
removeData in class MapPoint
Parameters:
key - The key provided by the caller.
Since:
BlackBerry API 6.0.0

getData

public Object getData(Object key)
Retrieves existing data for a specified key.

Overrides:
getData in class MapPoint
Parameters:
key - The key provided by the caller.
Returns:
The stored data or null if no data is found for that key or if the key is not valid.
Since:
BlackBerry API 6.0.0

toString

public String toString()
Generates the string representation for this Location object.

Overrides:
toString in class MapPoint
Returns:
Returns the string representation for the location.
See Also:
Object.toString()
Since:
BlackBerry API 6.0.0





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