User`s guide

4 Using MWArra y Classes
new Character('g')
};
int[] dims = {1, 8};
MWCharArray a1 = MWCharArray.newInstance(dims, x1);
MWCharArray a2 = MWCharArray.newInstance(dims, x2);
MWCharArray a3 = MWCharArray.newInstance(dims, x3);
Constructing a Two-D im ensional Character Arra y . This exam ple
constructs the two-dimensional
char array of the previous example:
char[] x1 = ('A', 'A', ' ', 'n', 'S', 'o', 't', 't', 'r', 'h',
'i', 'e', 'n', 'r', 'g', ' ', '\0', 'S', '\0', 't',
'\0', 'r', '\0', 'i', '\0', 'n', '\0', 'g'};
int[] dims = {2, 14};
MWCharArray a1 = MWCharArray.newInstance(dims, x1);
Note that the array of characters supplied to initialize the array is arranged
in column-wise order, and the end of the s horter string is padded with
Null
characters (’\0’). Higher dimensional character arrays can b e constructed
using the sam e procedure.
Accessing MWCharArray Elements
The MWCharArray class provides methods for a ccessing and modifying array
data in the form of
get and set methods. The following table lists the get
and set methods.
Method Usage
get(int)
Returns the element at the one-based index as type
java.lang.Character (inherited from MWArray).
get(int[])
Returns the element at the one -based index array as
type
java.lang.Character (inherited from MWArray).
getChar(int)
Returns the element at the one-based index as type
char.
getChar(int[])
Returns the element at the one -based index array as
type
char.
4-30