| Method from org.apache.cocoon.poi.hssf.record.FormulaRecord Detail: |
protected void fillFields(byte[] data,
short size,
int offset) {
field_1_row = LittleEndian.getShort(data, 0 + offset);
field_2_column = LittleEndian.getShort(data, 2 + offset);
field_3_xf = LittleEndian.getShort(data, 4 + offset);
field_4_value = LittleEndian.getDouble(data, 6 + offset);
field_5_options = LittleEndian.getShort(data, 14 + offset);
field_6_zero = LittleEndian.getInt(data, 16 + offset);
field_7_expression_len = LittleEndian.getShort(data, 20 + offset);
field_8_parsed_expr = getParsedExpressionTokens(data, size,
offset);
}
|
public short getColumn() {
return field_2_column;
}
|
public short getExpressionLength() {
return field_7_expression_len;
}
get the length (in number of tokens) of the expression |
public int getNumberOfExpressionTokens() {
return field_8_parsed_expr.size();
}
get the size of the stack |
public short getOptions() {
return field_5_options;
}
|
public List getParsedExpression() {
return ( List ) field_8_parsed_expr;
}
|
public short getRow() {
return field_1_row;
}
|
public short getSid() {
return sid;
}
|
public double getValue() {
return field_4_value;
}
get the calculated value of the formula |
public short getXFIndex() {
return field_3_xf;
}
|
public boolean isAfter(CellValueRecordInterface i) {
if (this.getRow() < i.getRow())
{
return false;
}
if ((this.getRow() == i.getRow())
&& (this.getColumn() < i.getColumn()))
{
return false;
}
if ((this.getRow() == i.getRow())
&& (this.getColumn() == i.getColumn()))
{
return false;
}
return true;
}
|
public boolean isBefore(CellValueRecordInterface i) {
if (this.getRow() > i.getRow())
{
return false;
}
if ((this.getRow() == i.getRow())
&& (this.getColumn() > i.getColumn()))
{
return false;
}
if ((this.getRow() == i.getRow())
&& (this.getColumn() == i.getColumn()))
{
return false;
}
return true;
}
|
public boolean isEqual(CellValueRecordInterface i) {
return ((this.getRow() == i.getRow())
&& (this.getColumn() == i.getColumn()));
}
|
public Ptg peekExpressionToken() {
return ( Ptg ) field_8_parsed_expr.peek();
}
peek at the token on the top of stack |
public Ptg popExpressionToken() {
return ( Ptg ) field_8_parsed_expr.pop();
}
pop a token off of the stack |
public void pushExpressionToken(Ptg ptg) {
field_8_parsed_expr.push(ptg);
}
push a token onto the stack |
public byte[] serialize() {
int ptgSize = getTotalPtgSize();
byte[] retval = new byte[ 28 + ptgSize ];
LittleEndian.putShort(retval, 0, sid);
LittleEndian.putShort(retval, 2, ( short ) (24 + ptgSize));
LittleEndian.putShort(retval, 4, getRow());
LittleEndian.putShort(retval, 6, getColumn());
LittleEndian.putShort(retval, 8, getXFIndex());
LittleEndian.putDouble(retval, 10, getValue());
LittleEndian.putShort(retval, 18, getOptions());
LittleEndian.putInt(retval, 20, field_6_zero);
LittleEndian.putShort(retval, 24, getExpressionLength());
serializePtgs(retval, 26);
return retval;
}
called by the class that is responsible for writing this sucker.
Subclasses should implement this so that their data is passed back in a
byte array. |
public void setColumn(short column) {
field_2_column = column;
}
|
public void setExpressionLength(short len) {
field_7_expression_len = len;
}
set the length (in number of tokens) of the expression |
public void setOptions(short options) {
field_5_options = options;
}
|
public void setRow(short row) {
field_1_row = row;
}
|
public void setValue(double value) {
field_4_value = value;
}
set the calculated value of the formula |
public void setXFIndex(short xf) {
field_3_xf = xf;
}
|
protected void validateSid(short id) {
if (id != sid)
{
throw new RecordFormatException("NOT A FORMULA RECORD");
}
}
called by constructor, should throw runtime exception in the event of a
record passed with a differing ID. |