first commit
This commit is contained in:
41
hrmsEjb/jxl/biff/formula/DoubleValue.java
Normal file
41
hrmsEjb/jxl/biff/formula/DoubleValue.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package jxl.biff.formula;
|
||||
|
||||
import common.Logger;
|
||||
import jxl.biff.DoubleHelper;
|
||||
|
||||
class DoubleValue extends NumberValue implements ParsedThing {
|
||||
private static Logger logger = Logger.getLogger(DoubleValue.class);
|
||||
|
||||
private double value;
|
||||
|
||||
public DoubleValue() {}
|
||||
|
||||
DoubleValue(double v) {
|
||||
this.value = v;
|
||||
}
|
||||
|
||||
public DoubleValue(String s) {
|
||||
try {
|
||||
this.value = Double.parseDouble(s);
|
||||
} catch (NumberFormatException e) {
|
||||
logger.warn(e, e);
|
||||
this.value = 0.0D;
|
||||
}
|
||||
}
|
||||
|
||||
public int read(byte[] data, int pos) {
|
||||
this.value = DoubleHelper.getIEEEDouble(data, pos);
|
||||
return 8;
|
||||
}
|
||||
|
||||
byte[] getBytes() {
|
||||
byte[] data = new byte[9];
|
||||
data[0] = Token.DOUBLE.getCode();
|
||||
DoubleHelper.getIEEEBytes(this.value, data, 1);
|
||||
return data;
|
||||
}
|
||||
|
||||
public double getValue() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user