Move the FormulaEvaluator code out of scratchpad
[poi.git] / src / java / org / apache / poi / hssf / record / formula / MemFuncPtg.java
blob89d4cae329010e94927145a2130014b0d6637b7d
1 /* ====================================================================
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 ==================================================================== */
20 * Ptg.java
22 * Created on October 28, 2001, 6:30 PM
24 package org.apache.poi.hssf.record.formula;
26 import org.apache.poi.util.LittleEndian;
27 import org.apache.poi.hssf.model.Workbook;
28 import org.apache.poi.hssf.record.RecordInputStream;
30 /**
31 * @author Glen Stampoultzis (glens at apache.org)
33 public class MemFuncPtg extends ControlPtg
36 public final static byte sid = 0x29;
37 private short field_1_len_ref_subexpression = 0;
39 public MemFuncPtg()
41 //Required for clone methods
44 /**Creates new function pointer from a byte array
45 * usually called while reading an excel file.
47 public MemFuncPtg( RecordInputStream in )
49 field_1_len_ref_subexpression = in.readShort();
52 public int getSize()
54 return 3;
57 public void writeBytes( byte[] array, int offset )
59 array[offset + 0] = sid ;
60 LittleEndian.putShort( array, offset + 1, (short)field_1_len_ref_subexpression );
63 public String toFormulaString(Workbook book)
65 return "";
68 public byte getDefaultOperandClass()
70 return 0;
73 public int getNumberOfOperands()
75 return field_1_len_ref_subexpression;
78 public Object clone()
80 MemFuncPtg ptg = new MemFuncPtg();
81 ptg.field_1_len_ref_subexpression = this.field_1_len_ref_subexpression;
82 return ptg;
85 public int getLenRefSubexpression()
87 return field_1_len_ref_subexpression;
90 public void setLenRefSubexpression(int len)
92 field_1_len_ref_subexpression = (short)len;