BBjVector

Description

A BBjVector object is a single dimensional array that maintains a list of objects and dynamically sizes to fit the number of objects added.

Creation

BBjAPI > BBjVector

The BBjVector object is created through the following BBjAPI object method:

Return Value Method
BBjVector makeVector()

Methods of BBjVector

Return Value Method
void addItem(Object item!)
void clear()
Object getItem(int index)
void insertItem(int index, Object item!)
Object removeItem(int index)
void setItem(int index, Object item!)
int size()

Remarks

Any allowed type or object can be put into a BBjVector. The index is 0-based. BBjVector implements java.util.Collection and java.util.List. Therefore, all methods of these interfaces are available on BBjVector.

The rules of this Java Collection can sometimes be surprising to BBj developers. For example, the contains(Object item!) method looks for a specific object. Because of this detail, developers may have to pay extra attention to the data type of the object being added to the BBjVector, as in the Example.

Constants

None.

Example

rem ' BBjVector Example

vector! = bbjapi().makeVector()
vector!.add("hello")
vector!.add("world")
vector!.add(vector!.size())
print vector!
print vector!.contains(2); rem ' false
print vector!.contains(new Integer(2)); rem ' true

See Also

BBjAPI

BBj Object Variables

BBj Object Creation and Assignment

BBj Object Error Handling

BBj Object Operators

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.