KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hssf > record > formula > OperationPtg


1 /* ====================================================================
2    Copyright 2003-2004 Apache Software Foundation
3
4    Licensed under the Apache License, Version 2.0 (the "License");
5    you may not use this file except in compliance with the License.
6    You may obtain a copy of the License at
7
8        http://www.apache.org/licenses/LICENSE-2.0
9
10    Unless required by applicable law or agreed to in writing, software
11    distributed under the License is distributed on an "AS IS" BASIS,
12    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    See the License for the specific language governing permissions and
14    limitations under the License.
15 ==================================================================== */

16
17 package org.apache.poi.hssf.record.formula;
18
19
20
21 /**
22  * defines a Ptg that is an operation instead of an operand
23  * @author andy
24  */

25
26 public abstract class OperationPtg extends Ptg
27 {
28     public final static int TYPE_UNARY = 0;
29     public final static int TYPE_BINARY = 1;
30     public final static int TYPE_FUNCTION = 2;
31
32     public abstract int getType();
33     
34     /**
35      * returns a string representation of the operations
36      * the length of the input array should equal the number returned by
37      * @see #getNumberOfOperands
38      *
39      */

40     public abstract String JavaDoc toFormulaString(String JavaDoc[] operands);
41     
42     /**
43      * The number of operands expected by the operations
44      */

45     public abstract int getNumberOfOperands();
46     
47     public byte getDefaultOperandClass() {return Ptg.CLASS_VALUE;}
48     
49 }
50
Popular Tags