2 import org.web3d.x3d.sai.*;
7 private static final int ROWS = 1;
14 public void getValue(
int[] values)
throws ArrayIndexOutOfBoundsException {
17 StringTokenizer tokens;
20 if (RLreturn == null) {
21 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
26 tokens =
new StringTokenizer(rep);
27 lines = Integer.valueOf(tokens.nextToken()).intValue();
29 if (values.length < lines) {
30 throw new ArrayIndexOutOfBoundsException(
"MFInt32 getValue passed array of insufficient size");
33 for (count1=0; count1 < lines; count1++) {
34 values[count1] = Integer.valueOf(tokens.nextToken()).intValue();
38 public int get1Value(
int index)
throws ArrayIndexOutOfBoundsException {
41 StringTokenizer tokens;
45 if (RLreturn == null) {
46 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
51 tokens =
new StringTokenizer(rep);
52 lines = Integer.valueOf(tokens.nextToken()).intValue();
54 rval =
new int[lines];
57 throw new ArrayIndexOutOfBoundsException(
"MFInt32 get1Value passed index out of bounds");
60 for (count1=0; count1 < lines; count1++) {
61 rval[count1] = Integer.valueOf(tokens.nextToken()).intValue();
66 public void setValue(
int size,
int[] value) {
70 if (size > value.length) {
76 for (count = 0; count < size; count++) {
77 val = val +
" " + value[count];
79 browser.newSendEvent(
this, val);
82 public void set1Value(
int index,
int value)
throws ArrayIndexOutOfBoundsException {
83 browser.newSendEvent(
this,
" ONEVAL " + index +
" " + value);
86 public void append(
int[] value) {
90 StringTokenizer tokens;
94 if (RLreturn == null) {
95 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
100 tokens =
new StringTokenizer(rep);
101 lines = Integer.valueOf(tokens.nextToken()).intValue();
103 append_size = value.length;
105 val =
" " + (lines + append_size);
107 for (count1 = 0; count1 < lines; count1++) {
108 val = val + tokens.nextToken();
111 for (count1 = 0; count1 < append_size; count1++) {
112 val = val +
" " + value[count1];
115 browser.newSendEvent(
this, val);
117 public void insertValue(
int index,
int[] value) {
121 StringTokenizer tokens;
125 if (RLreturn == null) {
126 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
131 tokens =
new StringTokenizer(rep);
132 lines = Integer.valueOf(tokens.nextToken()).intValue();
134 insert_size = value.length;
136 if ((index > lines) || (index < 0)) {
137 throw new ArrayIndexOutOfBoundsException(
"MFInt32 insertValue passed index out of bounds");
140 val =
" " + (lines + insert_size);
142 for (count1 = 0; count1 < index; count1++) {
143 val = val + tokens.nextToken();
146 for (count1 = 0; count1 < insert_size; count1++) {
147 val = val +
" " + value[count1];
150 for (count1 = index; count1 < lines; count1++) {
151 val = val + tokens.nextToken();
154 browser.newSendEvent(
this, val);