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

java.lang.Object
  extended by net.rim.device.api.lbs.maps.model.AbstractMappable
      extended by net.rim.device.api.lbs.maps.model.MapLine
All Implemented Interfaces:
Boxable, Mappable, Persistable
Direct Known Subclasses:
GsLine

public class MapLine
extends AbstractMappable
implements Persistable

Represents a line segment on the map.

Since:
BlackBerry API 7.0.0

Constructor Summary
MapLine()
          Constructs a new MapLine instance.
MapLine(MapPoint start, MapPoint end)
          Constructs a line with the given starting and ending points.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 LatLonRectangle getBoundingBox()
          Retrieves the latitude and longitude-based bounding box of this mappable item.
 MapPoint getEnd()
          Retrieves the ending point of the line.
 MapPoint getStart()
          Retrieves the starting point of the line.
 int hashCode()
          Returns a hash code value for the object.
 void setEnd(MapPoint end)
          Sets the ending point of the line.
 void setStart(MapPoint start)
          Sets the starting point of the line.
 
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, toString, wait, wait, wait
 



Constructor Detail

MapLine

public MapLine()
Constructs a new MapLine instance.

Since:
BlackBerry API 7.0.0

MapLine

public MapLine(MapPoint start,
               MapPoint end)
Constructs a line with the given starting and ending points.

Parameters:
start - The starting point.
end - The ending point.
Since:
BlackBerry API 7.0.0


Method Detail

getStart

public MapPoint getStart()
Retrieves the starting point of the line.

Returns:
The starting point.
Since:
BlackBerry API 7.0.0

setStart

public void setStart(MapPoint start)
Sets the starting point of the line.

Parameters:
start - The starting point.
Since:
BlackBerry API 7.0.0

getEnd

public MapPoint getEnd()
Retrieves the ending point of the line.

Returns:
The ending point.
Since:
BlackBerry API 7.0.0

setEnd

public void setEnd(MapPoint end)
Sets the ending point of the line.

Parameters:
end - The ending point.
Since:
BlackBerry API 7.0.0

getBoundingBox

public LatLonRectangle getBoundingBox()
Description copied from interface: Boxable
Retrieves the latitude and longitude-based bounding box of this mappable item.

Note: It's recommended that for classes that implement Boxable that the bounding box calculation be performed at request time, and not at modification time. When there are multiple modifications to perform, continuous recalculation of the bounding box is unnecessary.

It's also recommended that you cache the bounding box information once it's been calculated because requests for the bounding box may be frequent.

Specified by:
getBoundingBox in interface Boxable
Returns:
The axis-aligned bounding box or null if there is no bounding box.
Since:
BlackBerry API 7.0.0

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 AbstractMappable
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable
Since:
BlackBerry API 7.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 AbstractMappable
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:
Boolean.hashCode(), Hashtable
Since:
BlackBerry API 7.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