|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rexxla.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 | |
java.lang.Class |
componentType
|
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 | |
ArrayWrapper(java.lang.Object objArray)
Creates and returns an instance of this class, allowing easier access to Java arrays. |
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. |
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. |
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). |
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 |
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 |
public ArrayWrapper(java.lang.Object objArray)
get(int[] idxArr)
, put(Object valueObj, int[] idxArr)
,
supplier()
, supplier(boolean bRexxStyle)
and
( boolean bSupplier, boolean bRexxStyle )
are modelled after ooRexx (eg. cf. ooRexx class
Array
).
objArray
- the array object for which an ArrayWrapper instance is soughtMethod Detail |
public int dimension(int i)
i
- indicates the dimension of interest (Java index, i.e. first dimension to be
indicated/indexed with the value 0
).
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 Supplier supplier()
0
and is
enclosed in square brackets).
Supplier
, allowing for enumerating the contents of the array.public 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 |