📄 cellreference3d.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: CellReference3d.java
package jxl.biff.formula;
import common.Logger;
import jxl.Cell;
import jxl.biff.CellReferenceHelper;
import jxl.biff.IntegerHelper;
// Referenced classes of package jxl.biff.formula:
// Operand, FormulaException, ParsedThing, ExternalSheet,
// Token
class CellReference3d extends Operand
implements ParsedThing
{
private static Logger logger;
private boolean columnRelative;
private boolean rowRelative;
private int column;
private int row;
private Cell relativeTo;
private int sheet;
private ExternalSheet workbook;
static Class class$jxl$biff$formula$CellReference3d; /* synthetic field */
public CellReference3d(Cell rt, ExternalSheet w)
{
relativeTo = rt;
workbook = w;
}
public CellReference3d(String s, ExternalSheet w)
throws FormulaException
{
workbook = w;
columnRelative = true;
rowRelative = true;
int sep = s.indexOf(33);
String cellString = s.substring(sep + 1);
column = CellReferenceHelper.getColumn(cellString);
row = CellReferenceHelper.getRow(cellString);
String sheetName = s.substring(0, sep);
if(sheetName.charAt(0) == '\'' && sheetName.charAt(sheetName.length() - 1) == '\'')
sheetName = sheetName.substring(1, sheetName.length() - 1);
sheet = w.getExternalSheetIndex(sheetName);
if(sheet < 0)
throw new FormulaException(FormulaException.SHEET_REF_NOT_FOUND, sheetName);
else
return;
}
public int read(byte data[], int pos)
{
sheet = IntegerHelper.getInt(data[pos], data[pos + 1]);
row = IntegerHelper.getInt(data[pos + 2], data[pos + 3]);
int columnMask = IntegerHelper.getInt(data[pos + 4], data[pos + 5]);
column = columnMask & 0xff;
columnRelative = (columnMask & 0x4000) != 0;
rowRelative = (columnMask & 0x8000) != 0;
return 6;
}
public int getColumn()
{
return column;
}
public int getRow()
{
return row;
}
public void getString(StringBuffer buf)
{
CellReferenceHelper.getCellReference(sheet, column, !columnRelative, row, !rowRelative, workbook, buf);
}
byte[] getBytes()
{
byte data[] = new byte[7];
data[0] = Token.REF3D.getCode();
IntegerHelper.getTwoBytes(sheet, data, 1);
IntegerHelper.getTwoBytes(row, data, 3);
int grcol = column;
if(rowRelative)
grcol |= 0x8000;
if(columnRelative)
grcol |= 0x4000;
IntegerHelper.getTwoBytes(grcol, data, 5);
return data;
}
public void adjustRelativeCellReferences(int colAdjust, int rowAdjust)
{
if(columnRelative)
column += colAdjust;
if(rowRelative)
row += rowAdjust;
}
public void columnInserted(int sheetIndex, int col, boolean currentSheet)
{
if(sheetIndex != sheet)
return;
if(column >= col)
column++;
}
void columnRemoved(int sheetIndex, int col, boolean currentSheet)
{
if(sheetIndex != sheet)
return;
if(column >= col)
column--;
}
void rowInserted(int sheetIndex, int r, boolean currentSheet)
{
if(sheetIndex != sheet)
return;
if(row >= r)
row++;
}
void rowRemoved(int sheetIndex, int r, boolean currentSheet)
{
if(sheetIndex != sheet)
return;
if(row >= r)
row--;
}
static Class class$(String x0)
{
return Class.forName(x0);
ClassNotFoundException x1;
x1;
throw new NoClassDefFoundError(x1.getMessage());
}
static
{
logger = Logger.getLogger(class$jxl$biff$formula$CellReference3d != null ? class$jxl$biff$formula$CellReference3d : (class$jxl$biff$formula$CellReference3d = class$("jxl.biff.formula.CellReference3d")));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -