jasp.vbs
Class vbarray

java.lang.Object
  |
  +--jasp.vbs.vbarray

public class vbarray
extends java.lang.Object

This class implements VBScript Array.

Note: Only supports that the dimensions of an array is less than four.


Constructor Summary
vbarray()
          Constructs a vbarray without dimension.
vbarray(int d1)
          Constructs a one-dimensional vbarray object.
vbarray(int d1, int d2)
          Constructs a two-dimensional vbarray object.
vbarray(int d1, int d2, int d3)
          Constructs a three-dimensional vbarray object.
vbarray(int d1, int d2, int d3, int d4)
          Constructs a four-dimensional vbarray object.
 
Method Summary
 vbarray clone_()
          Clone this vbarray.
 int dimensions()
          Returns the number of dimensions in a vbarray.
 variant elementAt(int i)
          Extracts an element of a one-dimensional vbarray as a variant.
 variant elementAt(int i1, int i2)
          Extracts an element of a two-dimensional vbarray as a variant.
 variant elementAt(int i1, int i2, int i3)
          Extracts an element of a three-dimensional vbarray as a variant.
 variant elementAt(int i1, int i2, int i3, int i4)
          Extracts an element of a four-dimensional vbarray as a variant.
 void erase()
          Reinitializes the elements of fixed-size arrays and deallocates dynamic-array storage space.
 int getCount()
          Gets the number of elements contained in the vbarray.
 variant getItem(int index)
          Gets the element at the specified index.
 void preserve(int a0)
          Declares dynamic-array variables, and allocates or reallocates storage space.
 void preserve(int a0, int a1)
          Declares dynamic-array variables, and allocates or reallocates storage space at procedure level.
 void preserve(int a0, int a1, int a2)
          Declares dynamic-array variables, and allocates or reallocates storage space at procedure level.
 void preserve(int a0, int a1, int a2, int a3)
          Declares dynamic-array variables, and allocates or reallocates storage space at procedure level.
 void redim(int a0)
          Re-Declares dynamic-array variables, and allocates or reallocates storage space.
 void redim(int a0, int a1)
          Re-Declares dynamic-array variables, and allocates or reallocates storage space.
 void redim(int a0, int a1, int a2)
          Re-Declares dynamic-array variables, and allocates or reallocates storage space.
 void redim(int a0, int a1, int a2, int a3)
          Re-Declares dynamic-array variables, and allocates or reallocates storage space.
 void setItem(int index, double va)
          Assigns an element of a vbarray.
 void setItem(int index, int va)
          Assigns an element of a vbarray.
 void setItem(int index, java.lang.Object va)
          Assigns an element of a vbarray.
 void setItem(int index, java.lang.String va)
          Assigns an element of a vbarray.
 void setItem(int index, variant va)
          Assigns an element of a vbarray.
 void setItem(int index, vbcurrency va)
          Assigns an element of a vbarray.
 void setItem(int index, vbdate va)
          Assigns an element of a vbarray.
 void setObject(int index, java.lang.Object v)
          Sets an element of a vbarray.
 void setObject(int index, variant v)
          Sets an element of a vbarray.
 byte[] toBytes()
          Converts an entire vbarray to a Java array.
 int UBound(int i)
          Returns the highest index value used in the specified dimension of the vbarray.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

vbarray

public vbarray()
Constructs a vbarray without dimension.

vbarray

public vbarray(int d1)
Constructs a one-dimensional vbarray object.
Parameters:
d1 - The number of elements.

vbarray

public vbarray(int d1,
               int d2)
Constructs a two-dimensional vbarray object.
Parameters:
d1 - The number of elements in the first dimension.
d2 - The number of elements in the second dimension.

vbarray

public vbarray(int d1,
               int d2,
               int d3)
Constructs a three-dimensional vbarray object.
Parameters:
d1 - The number of elements in the first dimension.
d2 - The number of elements in the second dimension.
d3 - The number of elements in the third dimension.

vbarray

public vbarray(int d1,
               int d2,
               int d3,
               int d4)
Constructs a four-dimensional vbarray object.
Parameters:
d1 - The number of elements in the first dimension.
d2 - The number of elements in the second dimension.
d3 - The number of elements in the three dimension.
d4 - The number of elements in the fourth dimension.
Method Detail

elementAt

public variant elementAt(int i)
                  throws java.lang.Exception
Extracts an element of a one-dimensional vbarray as a variant.
Parameters:
i - The element index, which ranges from the index of the lower bound to the index of the upper bound.
Returns:
the element value.

elementAt

public variant elementAt(int i1,
                         int i2)
                  throws java.lang.Exception
Extracts an element of a two-dimensional vbarray as a variant.
Parameters:
i1 - The first dimension index of the element that is extracted, which ranges from 0 to UBound(1).
i2 - The second dimension index of the element that is extracted, which ranges from 0 to UBound(2).

elementAt

public variant elementAt(int i1,
                         int i2,
                         int i3)
                  throws java.lang.Exception
Extracts an element of a three-dimensional vbarray as a variant.
Parameters:
i1 - The first dimension index of the element that is extracted, which ranges from 0 to UBound(1).
i2 - The second dimension index of the element that is extracted, which ranges from 0 to UBound(2).
i3 - The third dimension index of the element that is extracted, which ranges from 0 to UBound(3).

elementAt

public variant elementAt(int i1,
                         int i2,
                         int i3,
                         int i4)
                  throws java.lang.Exception
Extracts an element of a four-dimensional vbarray as a variant.
Parameters:
i1 - The first dimension index of the element that is extracted, which ranges from 0 to UBound(1).
i2 - The second dimension index of the element that is extracted, which ranges from 0 to UBound(2).
i3 - The third dimension index of the element that is extracted, which ranges from 0 to UBound(3).
i4 - The fourth dimension index of the element that is extracted, which ranges from 0 to UBound(4).

getCount

public int getCount()
Gets the number of elements contained in the vbarray.
Returns:
The number of elements contained in the vbarray.

getItem

public variant getItem(int index)
                throws java.lang.Exception
Gets the element at the specified index.
Parameters:
index - The zero-based index.
Returns:
the element value.

UBound

public int UBound(int i)
           throws java.lang.Exception
Returns the highest index value used in the specified dimension of the vbarray.
Parameters:
i - The dimension of the vbarray for which the higher bound index is wanted.

redim

public void redim(int a0)
Re-Declares dynamic-array variables, and allocates or reallocates storage space.
Parameters:
a0 - The number of elements.

redim

public void redim(int a0,
                  int a1,
                  int a2,
                  int a3)
Re-Declares dynamic-array variables, and allocates or reallocates storage space.
Parameters:
a0 - The number of elements in the first dimension.
a1 - The number of elements in the second dimension.
a2 - The number of elements in the third dimension.
a3 - The number of elements in the fourth dimension.

redim

public void redim(int a0,
                  int a1,
                  int a2)
Re-Declares dynamic-array variables, and allocates or reallocates storage space.
Parameters:
a0 - The number of elements in the first dimension.
a1 - The number of elements in the second dimension.
a2 - The number of elements in the third dimension.

redim

public void redim(int a0,
                  int a1)
Re-Declares dynamic-array variables, and allocates or reallocates storage space.
Parameters:
a0 - The number of elements in the first dimension.
a1 - The number of elements in the second dimension.

preserve

public void preserve(int a0)
Declares dynamic-array variables, and allocates or reallocates storage space. You can resize only the last array dimension, and cannot change the number of dimensions at all.
Parameters:
a0 - The number of elements in the first dimension.

preserve

public void preserve(int a0,
                     int a1,
                     int a2,
                     int a3)
Declares dynamic-array variables, and allocates or reallocates storage space at procedure level. You can resize only the last array dimension, and cannot change the number of dimensions at all.
Parameters:
a0 - The number of elements in the first dimension.
a1 - The number of elements in the second dimension.
a2 - The number of elements in the third dimension.
a3 - The number of elements in the four dimension.

preserve

public void preserve(int a0,
                     int a1,
                     int a2)
Declares dynamic-array variables, and allocates or reallocates storage space at procedure level. You can resize only the last array dimension, and cannot change the number of dimensions at all.
Parameters:
a0 - The number of elements in the first dimension.
a1 - The number of elements in the second dimension.
a2 - The number of elements in the third dimension.

preserve

public void preserve(int a0,
                     int a1)
Declares dynamic-array variables, and allocates or reallocates storage space at procedure level. You can resize only the last array dimension, and cannot change the number of dimensions at all.
Parameters:
a0 - The number of elements in the first dimension.
a1 - The number of elements in the second dimension.

erase

public void erase()
Reinitializes the elements of fixed-size arrays and deallocates dynamic-array storage space.

dimensions

public int dimensions()
Returns the number of dimensions in a vbarray.
Returns:
the number of dimensions in a vbarray.

toBytes

public byte[] toBytes()
               throws java.lang.Exception
Converts an entire vbarray to a Java array.
Returns:
the flattened contents of the array.

setItem

public void setItem(int index,
                    variant va)
             throws java.lang.Exception
Assigns an element of a vbarray.
Parameters:
index - The element index.
va - The new element value.

setItem

public void setItem(int index,
                    vbcurrency va)
             throws java.lang.Exception
Assigns an element of a vbarray.
Parameters:
index - The element index.
va - The new element value.

setItem

public void setItem(int index,
                    vbdate va)
             throws java.lang.Exception
Assigns an element of a vbarray.
Parameters:
index - The element index.
va - The new element value.

setItem

public void setItem(int index,
                    int va)
             throws java.lang.Exception
Assigns an element of a vbarray.
Parameters:
index - The element index.
va - The new element value.

setItem

public void setItem(int index,
                    double va)
             throws java.lang.Exception
Assigns an element of a vbarray.
Parameters:
index - The element index.
va - The new element value.

setItem

public void setItem(int index,
                    java.lang.String va)
             throws java.lang.Exception
Assigns an element of a vbarray.
Parameters:
index - The element index.
va - The new element value.

setItem

public void setItem(int index,
                    java.lang.Object va)
             throws java.lang.Exception
Assigns an element of a vbarray.
Parameters:
index - The element index.
va - The new element value.

setObject

public void setObject(int index,
                      variant v)
               throws java.lang.Exception
Sets an element of a vbarray.
Parameters:
index - The element index.
v - The new element value.

setObject

public void setObject(int index,
                      java.lang.Object v)
               throws java.lang.Exception
Sets an element of a vbarray.
Parameters:
index - The element index.
v - The new element value.

clone_

public vbarray clone_()
Clone this vbarray.
Returns:
a new vbarray.