|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Vector
net.rim.device.api.lbs.maps.utils.MappableVector
public class MappableVector
Represents a vector of Mappable objects.
| 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()
Retrieves the latitude and longitude-based bounding box of this mappable item. |
|
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 |
removeAllElements()
Removes all components from this vector and sets its size to zero. |
|
boolean |
removeElement(Object obj)
Removes the first occurrence of the argument from this vector. |
|
void |
removeElementAt(int index)
Deletes the component at the specified index. |
|
void |
setElementAt(Object element,
int index)
Sets the component at the specified index of this
vector to be the specified object. |
|
void |
setSize(int newSize)
Sets the size of this vector. |
|
| Methods inherited from class java.util.Vector |
|---|
capacity, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, size, toString, trimToSize |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MappableVector()
MappableVector instance.
public MappableVector(int initialCapacity)
MappableVector instance using the initial
capacity of the vector.
initialCapacity - The initial capacity of the vector.
public MappableVector(int initialCapacity,
int capacityIncrement)
MappableVector instance using the initial
capacity and capacity increment for the vector.
initialCapacity - the initial capacity of the vector.capacityIncrement - The amount by which the capacity is
increased when the vector overflows.public MappableVector(Mappable[] data)
MappableVector instance using the
specified array.
data - An array of mappable items to initially populate this
vector with.| Method Detail |
|---|
public void addElement(Object element)
Vector
addElement in class Vectorelement - the component to be added.Vector.addElement(Object)
public void insertElementAt(Object element,
int index)
Vectorindex. 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.
insertElementAt in class Vectorelement - the component to insert.index - where to insert the new component.Vector.insertElementAt(Object, int)
public void setElementAt(Object element,
int index)
Vectorindex 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.
setElementAt in class Vectorelement - what the component is to be set to.index - the specified index.Vector.setElementAt(Object, int)public void removeAllElements()
Vector
removeAllElements in class Vectorpublic boolean removeElement(Object obj)
Vector
removeElement in class Vectorobj - the component to be removed.
true if the argument was a component of this
vector; false otherwise.public void removeElementAt(int index)
Vectorindex is shifted downward to have an index one
smaller than the value it had previously.
The index must be a value greater than or equal to 0
and less than the current size of the vector.
removeElementAt in class Vectorindex - the index of the object to remove.Vector.size()public void setSize(int newSize)
Vectornull items are added to the end of
the vector. If the new size is less than the current size, all
components at index newSize and greater are discarded.
setSize in class VectornewSize - the new size of this vector.public LatLonRectangle getBoundingBox()
BoxableNote: 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.
getBoundingBox in interface Boxablenull if
there is no bounding box.Boxable.getBoundingBox()public Mappable mappableAt(int index)
elementAt(int) with the exception that
the return is of type Mappable.
index - The index for the Mappable entity.
public void addAllMappables(Vector collection)
Mappable in the given collection.
For elements that are not mappable, they are not added to this
collection.
collection - The collection to add all Mappable objects.public void addAllMappables(Mappable[] data)
data - The data for the array of Mappable items.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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