BBjVector::insertItem

Description

Inserts an object into the vector.

Syntax

Return Value

Method

void

insertItem(int index, Object item!)

Parameters

Variable

Description

index

This is the 0-based index at which the object will be inserted into the vector. The index must be less than or equal to the size of the vector.

item!

The object to be inserted into the vector.

Return Value

None.

Remarks

Each object in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than its previous value.

Example

REM Insert an item into a BBjVector object

REM Obtain the instance of the BBjAPI object
LET myAPI!=BBjAPI()

REM Create an instance of the BBjVector object
LET myVector!=myAPI!.makeVector()

REM Create values to add into the BBjVector object
A! = new java.lang.Integer(1)
A = 2
B! = new java.lang.String("Item 3")
B$ = "Item 4"

REM Insert the above values into the BBjVector object
myVector!.insertItem(0,A!)
myVector!.insertItem(0,A)
myVector!.insertItem(0,B!)
myVector!.insertItem(0,B$)

REM Get the value at the specified index, this returns the Integer 1
ITEM1!=myVector!.getItem(3)

RELEASE

See Also

BBjAPI

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