net.rim.device.api.lbs.maps.utils
Class MappableVector

java.lang.Object
  extended by java.util.Vector
      extended by net.rim.device.api.lbs.maps.utils.MappableVector

public class MappableVector
extends Vector

Represents a vector of Mappable objects.

Since:
BlackBerry API 6.0.0

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Constructor Summary
MappableVector()
          Constructs a new MappableVector instance.
MappableVector(int initialCapacity)
          Constructs a new MappableVector instance using the initial capacity of the vector.
MappableVector(int initialCapacity, int capacityIncrement)
          Constructs a new MappableVector instance using the initial capacity and capacity increment for the vector.
MappableVector(Mappable[] data)
          Constructs a copy of a MappableVector instance using the specified array.
 
Method Summary
 void addAllMappables(Vector collection)
          Adds all objects that are of type Mappable in the given collection.
 void addAllMappables(Mappable[] data)
          Adds all objects in the given array to this collection.
 void addElement(Object element)
          Adds the specified component to the end of this vector, increasing its size by one.
 LatLonRectangle getBoundingBox()
           
 void insertElementAt(Object element, int index)
          Inserts the specified object as a component in this vector at the specified index.
 Mappable mappableAt(int index)
          Retrieves the Mappable entity at the given index.
 void setElementAt(Object element, int index)
          Sets the component at the specified index of this vector to be the specified object.
 
Methods inherited from class java.util.Vector
capacity, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setSize, size, toString, trimToSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 



Constructor Detail

MappableVector

public MappableVector()
Constructs a new MappableVector instance.

Since:
BlackBerry API 6.0.0

MappableVector

public MappableVector(int initialCapacity)
Constructs a new MappableVector instance using the initial capacity of the vector.

Parameters:
initialCapacity - The initial capacity of the vector.
Since:
BlackBerry API 6.0.0

MappableVector

public MappableVector(int initialCapacity,
                      int capacityIncrement)
Constructs a new MappableVector instance using the initial capacity and capacity increment for the vector.

Parameters:
initialCapacity - the initial capacity of the vector.
capacityIncrement - The amount by which the capacity is increased when the vector overflows.
Since:
BlackBerry API 6.0.0

MappableVector

public MappableVector(Mappable[] data)
Constructs a copy of a MappableVector instance using the specified array.

Parameters:
data - An array of mappable items to initially populate this vector with.
Since:
BlackBerry API 6.0.0


Method Detail

addElement

public void addElement(Object element)
Description copied from class: Vector
Adds the specified component to the end of this vector, increasing its size by one. The capacity of this vector is increased if its size becomes greater than its capacity.

Overrides:
addElement in class Vector
Parameters:
element - the component to be added.
See Also:
Vector.addElement(Object)
Since:
BlackBerry API 6.0.0

insertElementAt

public void insertElementAt(Object element,
                            int index)
Description copied from class: Vector
Inserts the specified object as a component in this vector at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.

The index must be a value greater than or equal to 0 and less than or equal to the current size of the vector.

Overrides:
insertElementAt in class Vector
Parameters:
element - the component to insert.
index - where to insert the new component.
See Also:
Vector.insertElementAt(Object, int)
Since:
BlackBerry API 6.0.0

setElementAt

public void setElementAt(Object element,
                         int index)
Description copied from class: Vector
Sets the component at the specified index of this vector to be the specified object. The previous component at that position is discarded.

The index must be a value greater than or equal to 0 and less than the current size of the vector.

Overrides:
setElementAt in class Vector
Parameters:
element - what the component is to be set to.
index - the specified index.
See Also:
Vector.setElementAt(Object, int)
Since:
BlackBerry API 6.0.0

getBoundingBox

public LatLonRectangle getBoundingBox()
See Also:
Boxable.getBoundingBox()
Since:
BlackBerry API 6.0.0

mappableAt

public Mappable mappableAt(int index)
Retrieves the Mappable entity at the given index. This method behaves similarly to elementAt(int) with the exception that the return is of type Mappable.

Parameters:
index - The index for the Mappable entity.
Returns:
The Mappable entity at the given index.
Since:
BlackBerry API 6.0.0

addAllMappables

public void addAllMappables(Vector collection)
Adds all objects that are of type Mappable in the given collection. For elements that are not mappable, they are not added to this collection.

Parameters:
collection - The collection to add all Mappable objects.
Since:
BlackBerry API 6.0.0

addAllMappables

public void addAllMappables(Mappable[] data)
Adds all objects in the given array to this collection.

Parameters:
data - The data for the array of Mappable items.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.