|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.bsf.engines.rexx.ArrayWrapper
This class serves as a wrapper for Java arrays. Its methods allow to fully interact with arrays of any type from Rexx (and other non-Java-based languages). Names of methods are called after their Object Rexx counterparts, if any.
Field Summary | |
protected static java.util.Hashtable |
array2wrapper
This hashtable serves as a registry for arrays already analyzed by an instance of this class. |
private java.lang.Object |
arrayObject
Stores the array object which this instance wraps. |
java.lang.Class |
componentType
Stores the class object used for the values stored in the array. |
int |
dimensions
Stores the total number of dimensions. |
int |
items
Stores the total size (maximum number of entries) of the entire array. |
int[] |
sizeOfDimension
Array of int which stores the size (maximum number of entries) of the appropriate dimension. |
Constructor Summary | |
private |
ArrayWrapper(java.lang.Object objArray)
A private constructor. |
Method Summary | |
int |
dimension(int i)
Returns the size of the given dimension. |
java.lang.Object |
get(int[] idxArr)
Get a value (item, element) from the array at the given position. |
static com.ibm.bsf.engines.rexx.ArrayWrapper |
getArrayWrapper(java.lang.Object objArray)
Only method to get an instance of ArrayWrapper created. |
java.lang.Object[] |
makearray(boolean bSupplier,
boolean bRexxStyle)
Modelled after Object Rexx MAKEARRAY method of the array class. |
void |
put(java.lang.Object valueObj,
int[] idxArr)
Put a value (item, element) into the array object at the given position. |
com.ibm.bsf.engines.rexx.Supplier |
supplier()
Creates a supplier object for allowing to enumerate the array together with the appropriate indices (Java style: index starts with 0 and is
enclosed in square brackets). |
com.ibm.bsf.engines.rexx.Supplier |
supplier(boolean bRexxStyle)
Creates a supplier object for allowing to enumerate the array together with the appropriate indices. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.util.Hashtable array2wrapper
private java.lang.Object arrayObject
public int dimensions
public int[] sizeOfDimension
int
which stores the size (maximum number of entries) of the appropriate dimension.
public int items
public java.lang.Class componentType
Constructor Detail |
private ArrayWrapper(java.lang.Object objArray)
array2wrapper
.
Method Detail |
public int dimension(int i)
public static com.ibm.bsf.engines.rexx.ArrayWrapper getArrayWrapper(java.lang.Object objArray)
array2wrapper
, that
instance is returned, else an instance is created, stored in the Hashtable and
then returned.
objArray
- the array object for which an ArrayWrapper instance is sought
public java.lang.Object get(int[] idxArr)
idxArr
- a one-dimensional array of int
s determining the location in the array.
public void put(java.lang.Object valueObj, int[] idxArr)
idxArr
- a one-dimensional array of int
s determining the location in the array.valueObj
- the Object to store; in the case of primitives the appropriate conversions
takes place, curtesy of Array
.public com.ibm.bsf.engines.rexx.Supplier supplier()
0
and is
enclosed in square brackets).
Supplier
, allowing for enumerating the contents of the array.public com.ibm.bsf.engines.rexx.Supplier supplier(boolean bRexxStyle)
bRexxStyle
- determines whether the index value is [Object] Rexx
style (index starts with 1
, multiple indices are separated by a comma)
or Java style (index starts with 0
, indices are enclosed in square brackets)
Supplier
, allowing for enumerating the contents of the array.public java.lang.Object[] makearray(boolean bSupplier, boolean bRexxStyle)
MAKEARRAY
method of the array class. This
method is executed synchronized.
bSupplier
- boolean value to indicate whether a supplier
array (containing the appropriate indices as Strings) is to be prepared and returned (if set to true
).bRexxStyle
- boolean value to indicate whether using Rexx (index starts at: 1
) or Java (index starts at: 0
) style for creating the indices for a supplier
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |