Move the FormulaEvaluator code out of scratchpad
[poi.git] / src / java / org / apache / poi / hssf / record / formula / EqualPtg.java
blob26f66e4fe2ce3c4ca5ab91df0b2bcf5d88ec0f94
2 /* ====================================================================
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================== */
19 package org.apache.poi.hssf.record.formula;
21 import org.apache.poi.hssf.model.Workbook;
22 import org.apache.poi.hssf.record.RecordInputStream;
24 /**
26 * @author andy
29 public class EqualPtg
30 extends OperationPtg
32 public final static int SIZE = 1;
33 public final static byte sid = 0x0b;
35 /** Creates new AddPtg */
37 public EqualPtg()
41 public EqualPtg(RecordInputStream in)
44 // doesn't need anything
47 public void writeBytes(byte [] array, int offset)
49 array[ offset + 0 ] = sid;
52 public int getSize()
54 return SIZE;
57 public int getType()
59 return TYPE_BINARY;
62 public int getNumberOfOperands()
64 return 2;
67 public String toFormulaString(Workbook book)
69 return "=";
72 public String toFormulaString(String[] operands) {
73 StringBuffer buffer = new StringBuffer();
76 buffer.append(operands[ 0 ]);
77 buffer.append(toFormulaString((Workbook)null));
78 buffer.append(operands[ 1 ]);
79 return buffer.toString();
82 public Object clone() {
83 return new EqualPtg();