Using Class Methods
A nonnumeric array type was specified.
Example — Constructing an Integer Array Object
Construct a scalar numeric array of type MWClassID.INT16:
double AReal = 24;
MWNumericArray A = new MWNumericArray(AReal, MWClassID.INT16);
System.out.println("Array A of type " + A.classID() + " = \n" + A);
When you run this example, the results are as follows:
Array A of type int16 =
24
Example — Constructing a Complex Array Object
Construct a numeric scalar having real and im aginary parts:
double AReal = 24;
double AImag = 5;
MWNumericArray A = new MWNumericArray(AReal, AImag);
System.out.println("Array A of type " + A.classID() + " = \n" + A);
When you run this example, the results are as follows:
Array A of type double =
24.0000 + 5.0000i
Constructing a Real or Com p lex Nu meric Arra y. Use this constructor
syntax to create a real nonscalar
MWNumericArray from a primitive Java typ e:
MWNumericArray(javatype realValue, MWClassID classid)
OrusethissyntaxtocreateacomplexnonscalarMWNumericArray from a
primitive Java type:
MWNumericArray(javatype realValue, javatype imagValue,
4-61
Komentarze do niniejszej Instrukcji