first commit
This commit is contained in:
27
hrmsEjb/jxl/biff/formula/BooleanValue.java
Normal file
27
hrmsEjb/jxl/biff/formula/BooleanValue.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package jxl.biff.formula;
|
||||
|
||||
class BooleanValue extends Operand implements ParsedThing {
|
||||
private boolean value;
|
||||
|
||||
public BooleanValue() {}
|
||||
|
||||
public BooleanValue(String s) {
|
||||
this.value = Boolean.valueOf(s).booleanValue();
|
||||
}
|
||||
|
||||
public int read(byte[] data, int pos) {
|
||||
this.value = (data[pos] == 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
byte[] getBytes() {
|
||||
byte[] data = new byte[2];
|
||||
data[0] = Token.BOOL.getCode();
|
||||
data[1] = (byte)((this.value == true) ? 1 : 0);
|
||||
return data;
|
||||
}
|
||||
|
||||
public void getString(StringBuffer buf) {
|
||||
buf.append((new Boolean(this.value)).toString());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user