2 import org.web3d.x3d.sai.*;
7 private static final int ROWS = 1;
14 public void getValue(
double[] value)
throws ArrayIndexOutOfBoundsException {
18 StringTokenizer tokens;
21 if (RLreturn == null) {
22 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
27 tokens =
new StringTokenizer(rep);
29 lines = Integer.valueOf(tokens.nextToken()).intValue();
31 if (value.length < lines) {
32 throw new ArrayIndexOutOfBoundsException(
"MFDouble getValue passed array of insufficient size");
35 for (count1=0; count1<lines; count1++) {
36 value[count1] = Double.valueOf(tokens.nextToken()).doubleValue();
40 public double get1Value(
int index)
throws ArrayIndexOutOfBoundsException {
44 StringTokenizer tokens;
48 if (RLreturn == null) {
49 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
54 tokens =
new StringTokenizer(rep);
56 lines = Integer.valueOf(tokens.nextToken()).intValue();
58 rval =
new double[lines];
61 throw new ArrayIndexOutOfBoundsException(
"MFDouble get1Value passed index out of bounds");
64 for (count1=0; count1<lines; count1++) {
65 rval[count1] = Double.valueOf(tokens.nextToken()).doubleValue();
71 public void setValue(
int size,
double[] value) {
75 if (size > value.length) {
81 for (count = 0; count < size; count++) {
82 val = val +
" " + value[count];
84 browser.newSendEvent(
this, val);
86 public void set1Value(
int index,
double value)
throws ArrayIndexOutOfBoundsException {
87 browser.newSendEvent(
this,
" ONEVAL " + index +
" " + value);
89 public void append(
double[] value){
93 StringTokenizer tokens;
97 if (RLreturn == null) {
98 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
103 tokens =
new StringTokenizer(rep);
104 lines = Integer.valueOf(tokens.nextToken()).intValue();
106 append_size = value.length;
108 val =
" " + (lines + append_size);
110 for (count1 = 0; count1 < lines; count1++) {
111 val = val + tokens.nextToken();
114 for (count1 = 0; count1 < append_size; count1++) {
115 val = val +
" " + value[count1];
118 browser.newSendEvent(
this, val);
120 public void insertValue(
int index,
double[] value)
throws ArrayIndexOutOfBoundsException {
124 StringTokenizer tokens;
128 if (RLreturn == null) {
129 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
134 tokens =
new StringTokenizer(rep);
135 lines = Integer.valueOf(tokens.nextToken()).intValue();
137 insert_size = value.length;
139 if ((index > lines) || (index < 0)) {
140 throw new ArrayIndexOutOfBoundsException(
"MFDouble insertValue passed index out of bounds");
143 val =
" " + (lines + insert_size);
145 for (count1 = 0; count1 < index; count1++) {
146 val = val + tokens.nextToken();
149 for (count1 = 0; count1 < insert_size; count1++) {
150 val = val +
" " + value[count1];
153 for (count1 = index; count1 < lines; count1++) {
154 val = val + tokens.nextToken();
157 browser.newSendEvent(
this, val);