01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
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: */
17: /*
18: * Created on May 8, 2005
19: *
20: */
21: package org.apache.poi.hssf.record.formula.eval;
22:
23: /**
24: * @author Amol S. Deshmukh < amolweb at ya hoo dot com >
25: *
26: */
27: public interface OperationEval extends Eval {
28:
29: /*
30: * Read this, this will make your work easier when coding
31: * an "evaluate()"
32: *
33: * Things to note when implementing evaluate():
34: * 1. Check the length of operands
35: * (use "switch(operands[x])" if possible)
36: *
37: * 2. The possible Evals that you can get as args to evaluate are one of:
38: * NumericValueEval, StringValueEval, RefEval, AreaEval
39: * 3. If it is RefEval, the innerValueEval could be one of:
40: * NumericValueEval, StringValueEval, BlankEval
41: * 4. If it is AreaEval, each of the values could be one of:
42: * NumericValueEval, StringValueEval, BlankEval, RefEval
43: *
44: * 5. For numeric functions/operations, keep the result in double
45: * till the end and before returning a new NumberEval, check to see
46: * if the double is a NaN - if NaN, return ErrorEval.ERROR_503
47: */
48: public abstract Eval evaluate(Eval[] evals, int srcCellRow,
49: short srcCellCol);
50:
51: public abstract int getNumberOfOperands();
52:
53: public abstract int getType();
54: }
|