⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sharednumberformularecord.java

📁 实现JAVA界面的代码GWT
💻 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:   SharedNumberFormulaRecord.java

package jxl.read.biff;

import common.Logger;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import jxl.*;
import jxl.biff.*;
import jxl.biff.formula.*;

// Referenced classes of package jxl.read.biff:
//            BaseSharedFormulaRecord, File, SheetImpl, BOFRecord, 
//            WorkbookParser, Record

public class SharedNumberFormulaRecord extends BaseSharedFormulaRecord
    implements NumberCell, FormulaData, NumberFormulaCell
{

    private static Logger logger;
    private double value;
    private NumberFormat format;
    private FormattingRecords formattingRecords;
    private static DecimalFormat defaultFormat = new DecimalFormat("#.###");
    static Class class$jxl$read$biff$SharedNumberFormulaRecord; /* synthetic field */

    public SharedNumberFormulaRecord(Record t, File excelFile, double v, FormattingRecords fr, ExternalSheet es, WorkbookMethods nt, 
            SheetImpl si)
    {
        super(t, fr, es, nt, si, excelFile.getPos());
        value = v;
        format = defaultFormat;
    }

    final void setNumberFormat(NumberFormat f)
    {
        if(f != null)
            format = f;
    }

    public double getValue()
    {
        return value;
    }

    public String getContents()
    {
        return Double.isNaN(value) ? "" : format.format(value);
    }

    public CellType getType()
    {
        return CellType.NUMBER_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);
            DoubleHelper.getIEEEBytes(value, data, 6);
            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;
        }
    }

    public NumberFormat getNumberFormat()
    {
        return format;
    }

    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$SharedNumberFormulaRecord != null ? class$jxl$read$biff$SharedNumberFormulaRecord : (class$jxl$read$biff$SharedNumberFormulaRecord = class$("jxl.read.biff.SharedNumberFormulaRecord")));
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -