MATLAB BUILDER JA 2 User's Guide Page 103

  • Download
  • Add to my manuals
  • Print
  • Page
    / 292
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 102
Guidelines for Working with MWArray Classes
Constructing an MWCharArray
The MWCharArray class provides a set of constructors and factory methods for
creating logical arrays. The following tableliststhesuppliedconstructors.
Constructor Usage
MWCharArray()
Empty char array
MWCharArray(type)
char
array with values initialized with supplied
data
Here, type represents supported Java types. MWCharArray supports the
following Java types:
char, java.lang.Character,andjava.lang.String.
In addition to supporting scalar values of the types listed, g eneral
N-dimensional arrays of each type are also supported. The following examples
create scalar
char arrays:
MWCharArray a1 = new MWCharArray('a');
MWCharArray a2 = new MWCharArray(new Character('a'));
Constructing Strings. Yo u can use the MWCharArray class to create character
strings,asshownintheseexamples:
char[] x1 = {'A', ' ', 'S', 't', 'r', 'i', 'n', 'g'};
String x2 = "A String";
Character[] x3 = {
new Character('A'),
new Character(' '),
new Character('S'),
new Character('t'),
new Character('r'),
new Character('i'),
new Character('n'),
new Character('g')};
MWCharArray a1 = new MWCharArray(x1);
MWCharArray a2 = new MWCharArray(x2);
MWCharArray a3 = new MWCharArray(x3);
4-27
Page view 102
1 2 ... 98 99 100 101 102 103 104 105 106 107 108 ... 291 292

Comments to this Manuals

No comments