ReferencePtgBase - handles references (such as A1, A2, IA4)
| Method from org.apache.poi.hssf.record.formula.RefPtgBase Detail: |
public final int getColumn() {
return column.getValue(field_2_col);
}
|
public int getColumnRawX() {
// TODO
return field_2_col;
}
|
public final byte getDefaultOperandClass() {
return Ptg.CLASS_REF;
}
|
public final int getRow() {
return field_1_row;
}
Returns the row number as a short, which will be
wrapped (negative) for values between 32769 and 65535 |
public final int getRowAsInt() {
return field_1_row;
}
Returns the row number as an int, between 0 and 65535 |
abstract protected byte getSid()
|
public final int getSize() {
return SIZE;
}
|
public final boolean isColRelative() {
return colRelative.isSet(field_2_col);
}
|
public final boolean isRowRelative() {
return rowRelative.isSet(field_2_col);
}
|
public final void setColRelative(boolean rel) {
field_2_col=colRelative.setBoolean(field_2_col,rel);
}
|
public final void setColumn(int col) {
if(col < 0 || col >= 0x100) {
throw new IllegalArgumentException("Specified colIx (" + col + ") is out of range");
}
field_2_col = column.setValue(field_2_col, col);
}
|
public final void setColumnRawX(int col) {
// TODO
field_2_col = col;
}
|
public final void setRow(int row) {
if(row < 0 || row >= MAX_ROW_NUMBER) {
throw new IllegalArgumentException("The row number, when specified as an integer, must be between 0 and " + MAX_ROW_NUMBER);
}
field_1_row = row;
}
|
public final void setRowRelative(boolean rel) {
field_2_col=rowRelative.setBoolean(field_2_col,rel);
}
|
public final String toFormulaString(HSSFWorkbook book) {
//TODO -- should we store a cellreference instance in this ptg?? but .. memory is an issue, i believe!
return (new CellReference(getRowAsInt(),getColumn(),!isRowRelative(),!isColRelative())).formatAsString();
}
|
public final String toString() {
CellReference cr = new CellReference(getRow(), getColumn(), !isRowRelative(),!isColRelative());
StringBuffer sb = new StringBuffer();
sb.append(getClass().getName());
sb.append(" [");
sb.append(cr.formatAsString());
sb.append("]");
return sb.toString();
}
|
public final void writeBytes(byte[] array,
int offset) {
array[offset] = (byte) (getSid() + getPtgClass());
LittleEndian.putShort(array, offset+1, (short)field_1_row);
LittleEndian.putShort(array, offset+3, (short)field_2_col);
}
|