2 import org.web3d.x3d.sai.*;
13 public void getValue(String[] value)
throws ArrayIndexOutOfBoundsException {
15 StringTokenizer tokens;
19 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
20 tokens =
new StringTokenizer(rep,
"\"");
22 tokens =
new StringTokenizer(RLreturn,
"\"");
27 if (value.length < (tokens.countTokens()/2)) {
28 throw new ArrayIndexOutOfBoundsException(
"MFString getValue passed array of insufficient size");
33 while(tokens.hasMoreTokens()) {
34 value[count] = tokens.nextToken();
35 if (value[count].equals(
"XyZZtitndi")) {
38 if (tokens.hasMoreTokens()) rep = tokens.nextToken();
43 public String get1Value(
int index)
throws ArrayIndexOutOfBoundsException {
46 StringTokenizer tokens;
50 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
51 tokens =
new StringTokenizer(rep,
"\"");
53 tokens =
new StringTokenizer(RLreturn,
"\"");
58 if (index > (tokens.countTokens()/2)) {
59 throw new ArrayIndexOutOfBoundsException(
"MFString getValue passed index out of bounds");
64 tstr =
new String[(tokens.countTokens()/2)];
66 while(tokens.hasMoreTokens()) {
67 tstr[count] = tokens.nextToken();
68 if (tstr[count].equals(
"XyZZtitndi")) {
71 if (tokens.hasMoreTokens()) rep = tokens.nextToken();
77 public void setValue(
int numStrings, String[] value) {
81 if (value.length < numStrings) {
82 numStrings = value.length;
85 sestr =
""+numStrings+
" ";
86 for (count = 0; count < numStrings; count++) {
87 sestr = sestr +
" " + count +
";" + value[count].length() +
":"+value[count] +
" ";
89 browser.newSendEvent(
this, sestr);
92 public void set1Value(
int index, String value) {
93 browser.newSendEvent(
this,
""+index+1+
" "+index+
";"+value.length()+
":"+value+
" ");
96 public void append(String[] value) {
98 StringTokenizer tokens;
108 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
109 tokens =
new StringTokenizer(rep,
"\"");
111 tokens =
new StringTokenizer(RLreturn,
"\"");
114 numRx = tokens.countTokens()/2;
115 numStrings = value.length;
117 sestr =
""+(numStrings+numRx)+
" ";
121 while(tokens.hasMoreTokens()) {
122 tstr = tokens.nextToken();
123 if (tstr.equals(
"XyZZtitndi")) {
126 sestr = sestr +
" " + index+
";" + tstr.length() +
":"+tstr +
" ";
128 if (tokens.hasMoreTokens()) {
129 skip = tokens.nextToken();
133 for (count = 0; count < value.length; count++) {
134 sestr = sestr +
" " + (count+index) +
";" + value[count].length() +
":"+value[count] +
" ";
136 browser.newSendEvent(
this, sestr);
140 public void insertValue(
int index, String[] value) {
142 StringTokenizer tokens;
152 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
153 tokens =
new StringTokenizer(rep,
"\"");
155 tokens =
new StringTokenizer(RLreturn,
"\"");
158 numRx = tokens.countTokens()/2;
159 numInsert = value.length;
160 numTotal = numInsert + numRx;
162 sestr =
""+numTotal+
" ";
166 while((tokens.hasMoreTokens() && (count < index))) {
167 tstr = tokens.nextToken();
168 if (tstr.equals(
"XyZZtitndi")) {
171 sestr = sestr +
" " + count +
";" + tstr.length() +
":"+tstr +
" ";
173 if (tokens.hasMoreTokens()) {
174 skip = tokens.nextToken();
178 for (
int i = 0; i < numInsert; i++) {
179 sestr = sestr +
" " + count +
";" + value[i].length() +
":" + value[i] +
" ";
183 while((tokens.hasMoreTokens() && (count < numTotal))) {
184 tstr = tokens.nextToken();
185 if (tstr.equals(
"XyZZtitndi")) {
188 sestr = sestr +
" " + count +
";" + tstr.length() +
":"+tstr +
" ";
190 if (tokens.hasMoreTokens()) {
191 skip = tokens.nextToken();
195 browser.newSendEvent(
this, sestr);