KickJava   Java API By Example, From Geeks To Geeks.

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


1         
2 /* ====================================================================
3    Copyright 2003-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        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 package org.apache.poi.hssf.record.formula;
19
20 import org.apache.poi.hssf.model.Workbook;
21
22 /**
23  * Ptg class to implement not equal
24  *
25  * @author fred at stsci dot edu
26  */

27 public class NotEqualPtg
28         extends OperationPtg
29 {
30     public final static int SIZE = 1;
31     public final static byte sid = 0x0e;
32
33     /**
34      * Creates new NotEqualPtg
35      */

36     public NotEqualPtg()
37     {
38     }
39
40     public NotEqualPtg( byte[] data, int offset )
41     {
42         // doesn't need anything
43
}
44
45     public void writeBytes( byte[] array, int offset )
46     {
47         array[offset + 0] = sid;
48     }
49
50     public int getSize()
51     {
52         return SIZE;
53     }
54
55     public int getType()
56     {
57         return TYPE_BINARY;
58     }
59
60     public int getNumberOfOperands()
61     {
62         return 2;
63     }
64
65     public String JavaDoc toFormulaString( Workbook book )
66     {
67         return "<>";
68     }
69
70     public String JavaDoc toFormulaString( String JavaDoc[] operands )
71     {
72         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
73
74         buffer.append( operands[0] );
75
76         buffer.append( toFormulaString( (Workbook) null ) );
77         buffer.append( operands[1] );
78
79         return buffer.toString();
80     }
81
82     public Object JavaDoc clone()
83     {
84         return new NotEqualPtg();
85     }
86
87 }
88
Popular Tags