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

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

public abstract class AbstractMappable
extends Object
implements Mappable, Persistable

A generic base implementation of most mappables. Developers can extend this class to create their own custom mappable objects. Subclasses need to over-ride the methods they're interested in. Subclasses of this class are required to implement hashCode() and equals(Object).

Since:
BlackBerry API 7.0.0

Constructor Summary
AbstractMappable()
          Default Constructor
AbstractMappable(AbstractMappable clone)
          Copies all parameters of the AbstractMappable to this instance of the AbstractMappable.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 Command[] getCommandsByType()
           
 Object getStyleId()
          Returns the style ID of this instance.
 int hashCode()
          Returns a hash code value for the object.
 boolean isClusterable()
          Determines if the mappable object can be grouped with other clusterable points of interest.
 int match(Object criterion)
           
 void setStyleId(Object styleId)
          Sets the style ID to use for this Mappable.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.rim.device.api.lbs.maps.Boxable
getBoundingBox
 



Constructor Detail

AbstractMappable

public AbstractMappable()
Default Constructor

Since:
BlackBerry API 7.0.0

AbstractMappable

public AbstractMappable(AbstractMappable clone)
Copies all parameters of the AbstractMappable to this instance of the AbstractMappable.

Parameters:
clone - AbstractMappable to clone.
Throws:
NullPointerException - if the parameter clone is null.
Since:
BlackBerry API 7.0.0


Method Detail

isClusterable

public boolean isClusterable()
Description copied from interface: Mappable
Determines if the mappable object can be grouped with other clusterable points of interest.

Specified by:
isClusterable in interface Mappable
Returns:
true if the mappable object is clusterable, false otherwise.
Since:
BlackBerry API 7.0.0

match

public int match(Object criterion)
Since:
BlackBerry API 7.0.0

getStyleId

public Object getStyleId()
Description copied from interface: Mappable
Returns the style ID of this instance. Style IDs are used to determine style information at rendering time.

Specified by:
getStyleId in interface Mappable
Returns:
The ID of this instance or null if no style ID is associated with the mappable object.
Since:
BlackBerry API 7.0.0

getCommandsByType

public Command[] getCommandsByType()
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 Object
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 Object
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

setStyleId

public void setStyleId(Object styleId)
Sets the style ID to use for this Mappable.

Parameters:
styleId - The ID to use for this Mappable. Can be shared among other Mappables.
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