📄 sharedstringformularecord.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: SharedStringFormulaRecord.java
package jxl.read.biff;
import common.Assert;
import common.Logger;
import jxl.*;
import jxl.biff.*;
import jxl.biff.formula.*;
// Referenced classes of package jxl.read.biff:
// BaseSharedFormulaRecord, File, Record, SheetImpl,
// BOFRecord, WorkbookParser
public class SharedStringFormulaRecord extends BaseSharedFormulaRecord
implements LabelCell, FormulaData, StringFormulaCell
{
private static final class EmptyString
{
private EmptyString()
{
}
EmptyString(_cls1 x0)
{
this();
}
}
private static Logger logger;
private String value;
protected static final EmptyString EMPTY_STRING = new EmptyString(null);
static Class class$jxl$read$biff$SharedStringFormulaRecord; /* synthetic field */
public SharedStringFormulaRecord(Record t, File excelFile, FormattingRecords fr, ExternalSheet es, WorkbookMethods nt, SheetImpl si, WorkbookSettings ws)
{
super(t, fr, es, nt, si, excelFile.getPos());
int pos = excelFile.getPos();
int filepos = excelFile.getPos();
Record nextRecord = excelFile.next();
int count;
for(count = 0; nextRecord.getType() != Type.STRING && count < 4; count++)
nextRecord = excelFile.next();
Assert.verify(count < 4, " @ " + pos);
byte stringData[] = nextRecord.getData();
int chars = IntegerHelper.getInt(stringData[0], stringData[1]);
boolean unicode = false;
int startpos = 3;
if(stringData.length == chars + 2)
{
startpos = 2;
unicode = false;
} else
if(stringData[2] == 1)
{
startpos = 3;
unicode = true;
} else
{
startpos = 3;
unicode = false;
}
if(!unicode)
value = StringHelper.getString(stringData, chars, startpos, ws);
else
value = StringHelper.getUnicodeString(stringData, chars, startpos);
excelFile.setPos(filepos);
}
public SharedStringFormulaRecord(Record t, File excelFile, FormattingRecords fr, ExternalSheet es, WorkbookMethods nt, SheetImpl si, EmptyString dummy)
{
super(t, fr, es, nt, si, excelFile.getPos());
value = "";
}
public String getString()
{
return value;
}
public String getContents()
{
return value;
}
public CellType getType()
{
return CellType.STRING_FORMULA;
}
public byte[] getFormulaData()
throws FormulaException
{
if(!getSheet().getWorkbookBof().isBiff8())
{
throw new FormulaException(FormulaException.BIFF8_SUPPORTED);
} else
{
FormulaParser fp = new FormulaParser(getTokens(), this, getExternalSheet(), getNameTable(), getSheet().getWorkbook().getSettings());
fp.parse();
byte rpnTokens[] = fp.getBytes();
byte data[] = new byte[rpnTokens.length + 22];
IntegerHelper.getTwoBytes(getRow(), data, 0);
IntegerHelper.getTwoBytes(getColumn(), data, 2);
IntegerHelper.getTwoBytes(getXFIndex(), data, 4);
data[6] = 0;
data[12] = -1;
data[13] = -1;
System.arraycopy(rpnTokens, 0, data, 22, rpnTokens.length);
IntegerHelper.getTwoBytes(rpnTokens.length, data, 20);
byte d[] = new byte[data.length - 6];
System.arraycopy(data, 6, d, 0, data.length - 6);
return d;
}
}
static Class class$(String x0)
{
return Class.forName(x0);
ClassNotFoundException x1;
x1;
throw new NoClassDefFoundError(x1.getMessage());
}
static
{
logger = Logger.getLogger(class$jxl$read$biff$SharedStringFormulaRecord != null ? class$jxl$read$biff$SharedStringFormulaRecord : (class$jxl$read$biff$SharedStringFormulaRecord = class$("jxl.read.biff.SharedStringFormulaRecord")));
}
// Unreferenced inner classes:
/* anonymous class */
static class _cls1
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -