if (text.length() == 0) {
setDouble(0.0);
setFlag(ModelFlag.EMPTY, true);
} else {
if (format == null) {
setValue(new SimpleType_double(text));
} else {
try {
ParsePosition pos = new ParsePosition(0);
setValue(new SimpleType_double(format.parse(text, pos).doubleValue()));
if (pos.getIndex() != text.length()) {
throw new Exception();
}
} catch (Exception ex) {
setValue(new SimpleType_double(text));
}
}
setFlag(ModelFlag.EMPTY, false);
}