From: Avik Sengupta Date: Tue, 11 Jun 2002 20:37:01 +0000 (+0000) Subject: dont want these any more, they have been refactored to AbstractFunctionPtg/FuncPtg... X-Git-Tag: REL_1_10~334 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0cd9bb54f9d8fe7f30af10d2d3d90cc34df63df5;p=poi.git dont want these any more, they have been refactored to AbstractFunctionPtg/FuncPtg/FuncVarPtg git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352670 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/record/formula/FunctionPtg.java b/src/java/org/apache/poi/hssf/record/formula/FunctionPtg.java deleted file mode 100644 index 17c9c98a65..0000000000 --- a/src/java/org/apache/poi/hssf/record/formula/FunctionPtg.java +++ /dev/null @@ -1,519 +0,0 @@ -package org.apache.poi.hssf.record.formula; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import org.apache.poi.util.LittleEndian; -import org.apache.poi.util.BinaryTree; -/** - * This class provides functions with variable arguments. - * @author Avik Sengupta - * @author Andrew C. Oliver (acoliver at apache dot org) - */ -public class FunctionPtg extends OperationPtg { - public final static short sid = 0x22; - private final static int SIZE = 4; - - private static BinaryTree map = produceHash(); - private static Object[][] functionData = produceFunctionData(); - private byte returnClass; - private byte[] paramClass; - - private byte field_1_num_args; - private short field_2_fnc_index; - - - /**Creates new function pointer from a byte array - * usually called while reading an excel file. - */ - public FunctionPtg(byte[] data, int offset) { - offset++; - field_1_num_args = data[ offset + 0 ]; - field_2_fnc_index = LittleEndian.getShort(data,offset + 1 ); - } - - /** - * Create a function ptg from a string tokenised by the parser - */ - protected FunctionPtg(String pName, byte pNumOperands) { - field_1_num_args = pNumOperands; - field_2_fnc_index = lookupIndex(pName); - try{ - returnClass = ( (Byte) functionData[field_2_fnc_index][0]).byteValue(); - paramClass = (byte[]) functionData[field_2_fnc_index][1]; - } catch (NullPointerException npe ) { - returnClass = Ptg.CLASS_VALUE; - paramClass = new byte[] {Ptg.CLASS_VALUE}; - } - } - - public String toString() { - StringBuffer buffer = new StringBuffer(); - buffer - .append("").append("\n") - .append(" field_1_num_args=").append(field_1_num_args).append("\n") - .append(" name =").append(lookupName(field_2_fnc_index)).append("\n") - .append(" field_2_fnc_index=").append(field_2_fnc_index).append("\n") - .append(""); - return buffer.toString(); - } - - public int getType() { - return -1; - } - - public int getNumberOfOperands() { - return field_1_num_args; - } - - public short getFunctionIndex() { - return field_2_fnc_index; - } - - public String getName() { - return lookupName(field_2_fnc_index); - } - - public String toFormulaString() { - return getName(); - } - - public String toFormulaString(String[] operands) { - StringBuffer buf = new StringBuffer(); - buf.append(getName()+"("); - if (operands.length >0) { - for (int i=0;i. - */ - -/* - * ValueVariableFunctionPtg.java - * - * Created on November 21, 2001, 7:02 PM - */ -package org.apache.poi.hssf.record.formula; - -import org.apache.poi.util.BitField; -import org.apache.poi.util.LittleEndian; - -import java.util.List; - -/** - * An excel function with variable number of value arguments. - * @author andy - */ - -public class ValueVariableFunctionPtg - extends OperationPtg -{ - public final static short sid = 0x42; - private final static short SIZE = 4; - private byte field_1_byte_1; - BitField numArgs = new BitField(0x7f); - BitField prompt = new BitField(0x80); - private short field_2_bytes; - BitField functionIndex = new BitField(0x7FFF); - BitField command = new BitField(0x8000); - - /** Creates new ValueVariableFunctionPtg */ - - public ValueVariableFunctionPtg() - { - } - - public ValueVariableFunctionPtg(byte [] data, int offset) - { - offset++; - field_1_byte_1 = data[ offset + 0 ]; - field_2_bytes = LittleEndian.getShort(data, offset + 1); - } - - public void writeBytes(byte [] array, int offset) - { - } - - public int getSize() - { - return SIZE; - } - - public short getNumArgs() - { - return numArgs.getShortValue(field_1_byte_1); - } - - public int getNumberOfOperands() - { - return getNumArgs(); - } - - public int getType() - { - return -1; - } - - public String toFormulaString() - { - return "NO IDEA YET VALUE VARIABLE"; - } - - - public String toFormulaString(String[] operands) { - return toFormulaString(); - } - - - - - -}