A nested class to hold range information
| Method from jxl.biff.formula.Area3d Detail: |
public void adjustRelativeCellReferences(int colAdjust,
int rowAdjust) {
if (columnFirstRelative)
{
columnFirst += colAdjust;
}
if (columnLastRelative)
{
columnLast += colAdjust;
}
if (rowFirstRelative)
{
rowFirst += rowAdjust;
}
if (rowLastRelative)
{
rowLast += rowAdjust;
}
}
Adjusts all the relative cell references in this formula by the
amount specified. Used when copying formulas |
public void columnInserted(int sheetIndex,
int col,
boolean currentSheet) {
if (sheetIndex != sheet)
{
return;
}
if (columnFirst >= col)
{
columnFirst++;
}
if (columnLast >= col)
{
columnLast++;
}
}
Called when a column is inserted on the specified sheet. Tells
the formula parser to update all of its cell references beyond this
column |
void columnRemoved(int sheetIndex,
int col,
boolean currentSheet) {
if (sheetIndex != sheet)
{
return;
}
if (col < columnFirst)
{
columnFirst--;
}
if (col < = columnLast)
{
columnLast--;
}
}
Called when a column is inserted on the specified sheet. Tells
the formula parser to update all of its cell references beyond this
column |
byte[] getBytes() {
byte[] data = new byte[11];
data[0] = Token.AREA3D.getCode();
IntegerHelper.getTwoBytes(sheet, data, 1);
IntegerHelper.getTwoBytes(rowFirst, data, 3);
IntegerHelper.getTwoBytes(rowLast, data, 5);
int grcol = columnFirst;
// Set the row/column relative bits if applicable
if (rowFirstRelative)
{
grcol |= 0x8000;
}
if (columnFirstRelative)
{
grcol |= 0x4000;
}
IntegerHelper.getTwoBytes(grcol, data, 7);
grcol = columnLast;
// Set the row/column relative bits if applicable
if (rowLastRelative)
{
grcol |= 0x8000;
}
if (columnLastRelative)
{
grcol |= 0x4000;
}
IntegerHelper.getTwoBytes(grcol, data, 9);
return data;
}
Gets the token representation of this item in RPN |
int getFirstColumn() {
return columnFirst;
}
Accessor for the first column |
int getFirstRow() {
return rowFirst;
}
Accessor for the first row |
int getLastColumn() {
return columnLast;
}
Accessor for the last column |
int getLastRow() {
return rowLast;
}
Accessor for the last row |
public void getString(StringBuffer buf) {
CellReferenceHelper.getCellReference
(sheet, columnFirst, rowFirst, workbook, buf);
buf.append(':");
CellReferenceHelper.getCellReference(columnLast, rowLast, buf);
}
Gets the string version of this area |
void handleImportedCellReferences() {
setInvalid();
}
If this formula was on an imported sheet, check that
cell references to another sheet are warned appropriately |
public int read(byte[] data,
int pos) {
sheet = IntegerHelper.getInt(data[pos], data[pos + 1]);
rowFirst = IntegerHelper.getInt(data[pos + 2], data[pos + 3]);
rowLast = IntegerHelper.getInt(data[pos + 4], data[pos + 5]);
int columnMask = IntegerHelper.getInt(data[pos + 6], data[pos + 7]);
columnFirst = columnMask & 0x00ff;
columnFirstRelative = ((columnMask & 0x4000) != 0);
rowFirstRelative = ((columnMask & 0x8000) != 0);
columnMask = IntegerHelper.getInt(data[pos + 8], data[pos + 9]);
columnLast = columnMask & 0x00ff;
columnLastRelative = ((columnMask & 0x4000) != 0);
rowLastRelative = ((columnMask & 0x8000) != 0);
return 10;
}
Reads the ptg data from the array starting at the specified position |
void rowInserted(int sheetIndex,
int row,
boolean currentSheet) {
if (sheetIndex != sheet)
{
return;
}
if (rowLast == 0xffff)
{
// area applies to the whole column, so nothing to do
return;
}
if (row < = rowFirst)
{
rowFirst++;
}
if (row < = rowLast)
{
rowLast++;
}
}
Called when a column is inserted on the specified sheet. Tells
the formula parser to update all of its cell references beyond this
column |
void rowRemoved(int sheetIndex,
int row,
boolean currentSheet) {
if (sheetIndex != sheet)
{
return;
}
if (rowLast == 0xffff)
{
// area applies to the whole column, so nothing to do
return;
}
if (row < rowFirst)
{
rowFirst--;
}
if (row < = rowLast)
{
rowLast--;
}
}
Called when a column is inserted on the specified sheet. Tells
the formula parser to update all of its cell references beyond this
column |
protected void setRangeData(int sht,
int colFirst,
int colLast,
int rwFirst,
int rwLast,
boolean colFirstRel,
boolean colLastRel,
boolean rowFirstRel,
boolean rowLastRel) {
sheet = sht;
columnFirst = colFirst;
columnLast = colLast;
rowFirst = rwFirst;
rowLast = rwLast;
columnFirstRelative = colFirstRel;
columnLastRelative = colLastRel;
rowFirstRelative = rowFirstRel;
rowLastRelative = rowLastRel;
}
Used by subclasses columns/row range to set the range information |