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

📄 builtinfunction.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:   BuiltInFunction.java

package jxl.biff.formula;

import common.Assert;
import common.Logger;
import java.util.Stack;
import jxl.WorkbookSettings;
import jxl.biff.IntegerHelper;

// Referenced classes of package jxl.biff.formula:
//            Operator, ParseItem, ParsedThing, Function, 
//            Token

class BuiltInFunction extends Operator
    implements ParsedThing
{

    private static Logger logger;
    private Function function;
    private WorkbookSettings settings;
    static Class class$jxl$biff$formula$BuiltInFunction; /* synthetic field */

    public BuiltInFunction(WorkbookSettings ws)
    {
        settings = ws;
    }

    public BuiltInFunction(Function f, WorkbookSettings ws)
    {
        function = f;
        settings = ws;
    }

    public int read(byte data[], int pos)
    {
        int index = IntegerHelper.getInt(data[pos], data[pos + 1]);
        function = Function.getFunction(index);
        Assert.verify(function != Function.UNKNOWN, "function code " + index);
        return 2;
    }

    public void getOperands(Stack s)
    {
        ParseItem items[] = new ParseItem[function.getNumArgs()];
        for(int i = function.getNumArgs() - 1; i >= 0; i--)
        {
            ParseItem pi = (ParseItem)s.pop();
            items[i] = pi;
        }

        for(int i = 0; i < function.getNumArgs(); i++)
            add(items[i]);

    }

    public void getString(StringBuffer buf)
    {
        buf.append(function.getName(settings));
        buf.append('(');
        int numArgs = function.getNumArgs();
        if(numArgs > 0)
        {
            ParseItem operands[] = getOperands();
            operands[0].getString(buf);
            for(int i = 1; i < numArgs; i++)
            {
                buf.append(',');
                operands[i].getString(buf);
            }

        }
        buf.append(')');
    }

    public void adjustRelativeCellReferences(int colAdjust, int rowAdjust)
    {
        ParseItem operands[] = getOperands();
        for(int i = 0; i < operands.length; i++)
            operands[i].adjustRelativeCellReferences(colAdjust, rowAdjust);

    }

    void columnInserted(int sheetIndex, int col, boolean currentSheet)
    {
        ParseItem operands[] = getOperands();
        for(int i = 0; i < operands.length; i++)
            operands[i].columnInserted(sheetIndex, col, currentSheet);

    }

    void columnRemoved(int sheetIndex, int col, boolean currentSheet)
    {
        ParseItem operands[] = getOperands();
        for(int i = 0; i < operands.length; i++)
            operands[i].columnRemoved(sheetIndex, col, currentSheet);

    }

    void rowInserted(int sheetIndex, int row, boolean currentSheet)
    {
        ParseItem operands[] = getOperands();
        for(int i = 0; i < operands.length; i++)
            operands[i].rowInserted(sheetIndex, row, currentSheet);

    }

    void rowRemoved(int sheetIndex, int row, boolean currentSheet)
    {
        ParseItem operands[] = getOperands();
        for(int i = 0; i < operands.length; i++)
            operands[i].rowRemoved(sheetIndex, row, currentSheet);

    }

    byte[] getBytes()
    {
        ParseItem operands[] = getOperands();
        byte data[] = new byte[0];
        for(int i = 0; i < operands.length; i++)
        {
            byte opdata[] = operands[i].getBytes();
            byte newdata[] = new byte[data.length + opdata.length];
            System.arraycopy(data, 0, newdata, 0, data.length);
            System.arraycopy(opdata, 0, newdata, data.length, opdata.length);
            data = newdata;
        }

        byte newdata[] = new byte[data.length + 3];
        System.arraycopy(data, 0, newdata, 0, data.length);
        newdata[data.length] = useAlternateCode() ? Token.FUNCTION.getCode2() : Token.FUNCTION.getCode();
        IntegerHelper.getTwoBytes(function.getCode(), newdata, data.length + 1);
        return newdata;
    }

    int getPrecedence()
    {
        return 3;
    }

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

⌨️ 快捷键说明

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