16 package com.generalrobotix.ui.view.graph;
18 import java.text.DecimalFormat;
19 import java.util.StringTokenizer;
32 value_ =
new Double[
size];
33 for (
int i = 0;
i <
size;
i ++) {
34 value_[
i] =
new Double(0.0);
36 df_ =
new DecimalFormat(
"0.####");
46 df_ =
new DecimalFormat(
"0.####");
59 value_ =
new Double[value.length];
60 for (
int i = 0;
i < value.length;
i ++) {
61 value_[
i] =
new Double(value[
i]);
63 df_ =
new DecimalFormat(
"0.####");
75 value_ =
new Double[value.length];
76 for (
int i = 0;
i < value.length;
i ++) {
77 value_[
i] =
new Double((
double)value[
i]);
79 df_ =
new DecimalFormat(
"0.####");
91 StringTokenizer token =
new StringTokenizer(value);
93 value_ =
new Double[token.countTokens()];
94 for (
int i = 0;
i < value_.length;
i ++) {
95 String str = token.nextToken();
96 if (str.equals(
"NaN") || str.equals(
"")) {
98 value_[
i] =
new Double(Double.NaN);
100 value_[
i] =
new Double(str);
101 if (value_[
i].isInfinite()) {
106 df_ =
new DecimalFormat(
"0.####");
115 if (isNaN_) {
return ""; }
117 StringBuffer strBuf =
new StringBuffer();
119 if (value_.length == 0)
return strBuf.toString();
120 strBuf.append(df_.format(value_[0]));
121 for (
int i = 1;
i < value_.length;
i ++) {
123 strBuf.append(df_.format(value_[
i]));
125 return strBuf.toString();
136 return (Object)value_;
148 value_ = (Double[])value;
157 for (
int i = 0;
i < value.length;
i ++) {
158 if (Double.isNaN(value[
i])) {
160 }
else if (Double.isInfinite(value[i])) {
163 value_[
i] =
new Double(value[i]);
173 if (str.equals(
"")) {
175 for (
int i = 0;
i < value_.length;
i ++) {
176 value_[
i] =
new Double(Double.NaN);
181 StringTokenizer token =
new StringTokenizer(str);
184 for (
int i = 0;
i < value_.length;
i ++) {
185 if (token.hasMoreTokens()) {
186 String
value = token.nextToken();
187 if (value.equals(
"NaN")) {
189 value_[
i] =
new Double(Double.NaN);
191 value_[
i] =
new Double(value);
192 if (value_[
i].isInfinite()) {
203 value_[index] =
new Double(value);
212 return value_.length;
221 return (Object)value_;
231 if (value_.length <= index)
return null;
232 return value_[index];
242 if (value_.length <= index)
return 0.0;
243 return value_[index].doubleValue();
253 if (value_.length <= index)
return 0.0f;
254 return value_[index].floatValue();
267 for (
int i = 0;
i < value_.length;
i ++) {
268 value[
i] = value_[
i].doubleValue();
273 for (
int i = 0;
i < value_.length;
i ++) {
274 value[
i] = value_[
i].floatValue();
279 for (
int i = 0;
i < value.length;
i ++) {
280 if (value[
i].isNaN()) {
283 }
else if (value[
i].isInfinite()) {
boolean _isValid(Double[] value)
SEDoubleArray(String value)
#define null
our own NULL pointer
double doubleValue(int index)
void setValue(Object value)
Double getValue(int index)
Double[] getDoubleArray()
SEDoubleArray(float value[])
float floatValue(int index)
SEDoubleArray(double value[])
void setValue(double[] value)
SEDoubleArray(Double value[])
void setValue(int index, double value)
Object fromString(String str)
void setValue(String str)