net.rim.device.api.lbs.maps.model.geospatial
Class GsRoot

java.lang.Object
  extended by net.rim.device.api.lbs.maps.model.AbstractMappable
      extended by net.rim.device.api.lbs.maps.model.geospatial.GsFolder
          extended by net.rim.device.api.lbs.maps.model.geospatial.GsRoot
All Implemented Interfaces:
Boxable, GsElement, Mappable, Persistable

public class GsRoot
extends GsFolder
implements Persistable

Represents the top-level container that contains a hierarchy of GsElement items and the StyleSet that is used to render the contents.

Since:
BlackBerry API 7.0.0

Constructor Summary
GsRoot()
          Constructs a new instance of GsRoot.
GsRoot(String name, String description)
          Constructs a GsRoot with the given name and description.
GsRoot(String name, String description, GsElement[] elements)
          Constructs a GsRoot with the given name, description, and contents.
GsRoot(String name, String description, GsElement[] elements, StyleSet styleSet)
          Constructs a GsRoot with the given name, description, contents, and style set.
 
Method Summary
 void decomposeAndAddToModel(MapDataModel model)
          Adds this root's contents to the given MapDataModel by iterating over all the elements within this root and its child folders and adding each discrete element to the model.
 void decomposeAndAddToModel(MapDataModel model, String tag)
          Add this root's contents to the given MapDataModel, tagging each element with the given tag.
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 GsFolder getParent()
          Retrieves the parent folder of this element.
 StyleSet getStyleSet()
          Retrieves the set of styles that are used to display this collection of geospatial data.
 int hashCode()
          Returns a hash code value for the object.
 void setParent(GsFolder parent)
          Sets the parent folder of this element.
 void setStyleSet(StyleSet newStyleSet)
          Sets the set of styles specific to this root.
 
Methods inherited from class net.rim.device.api.lbs.maps.model.geospatial.GsFolder
addElement, addElements, elements, equalsHierarchically, equalsNode, getBoundingBox, getDescription, getElementAt, getName, insertElementAt, isClusterable, removeAllElements, removeElement, removeElementAt, setDescription, setElementAt, setName, size
 
Methods inherited from class net.rim.device.api.lbs.maps.model.AbstractMappable
getCommandsByType, getStyleId, match, setStyleId
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.rim.device.api.lbs.maps.model.Mappable
getStyleId
 



Constructor Detail

GsRoot

public GsRoot()
Constructs a new instance of GsRoot.

Since:
BlackBerry API 7.0.0

GsRoot

public GsRoot(String name,
              String description)
Constructs a GsRoot with the given name and description.

Parameters:
name - The name of the container.
description - The description of the container.
Since:
BlackBerry API 7.0.0

GsRoot

public GsRoot(String name,
              String description,
              GsElement[] elements)
Constructs a GsRoot with the given name, description, and contents.

Parameters:
name - The name of the container.
description - The description of the container.
elements - The contents of the container.
Since:
BlackBerry API 7.0.0

GsRoot

public GsRoot(String name,
              String description,
              GsElement[] elements,
              StyleSet styleSet)
Constructs a GsRoot with the given name, description, contents, and style set.

Parameters:
name - The name of the container.
description - The description of the container.
elements - The contents of the container.
styleSet - The style set of the container.
Since:
BlackBerry API 7.0.0


Method Detail

getStyleSet

public StyleSet getStyleSet()
Retrieves the set of styles that are used to display this collection of geospatial data.

Returns:
The set of styles for this geospatial collection.
Since:
BlackBerry API 7.0.0

setStyleSet

public void setStyleSet(StyleSet newStyleSet)
Sets the set of styles specific to this root.

Parameters:
newStyleSet - The set of styles to use for this root.
Since:
BlackBerry API 7.0.0

getParent

public GsFolder getParent()
Description copied from interface: GsElement
Retrieves the parent folder of this element.

Specified by:
getParent in interface GsElement
Overrides:
getParent in class GsFolder
Returns:
The parent folder of this element.
Since:
BlackBerry API 7.0.0

setParent

public void setParent(GsFolder parent)
Description copied from interface: GsElement
Sets the parent folder of this element.

Specified by:
setParent in interface GsElement
Overrides:
setParent in class GsFolder
Parameters:
parent - The parent folder of this element.
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 GsFolder
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 GsFolder
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

decomposeAndAddToModel

public void decomposeAndAddToModel(MapDataModel model)
Adds this root's contents to the given MapDataModel by iterating over all the elements within this root and its child folders and adding each discrete element to the model.

Parameters:
model - The MapDataModel to add the contained elements to.
Since:
BlackBerry API 7.0.0

decomposeAndAddToModel

public void decomposeAndAddToModel(MapDataModel model,
                                   String tag)
Add this root's contents to the given MapDataModel, tagging each element with the given tag.

Parameters:
model - The MapDataModel to which the contained elements will be added.
tag - The tag to apply to each element.
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