KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > biff > formula > StringParseItem


1 /*********************************************************************
2 *
3 * Copyright (C) 2003 Andrew Khan
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ***************************************************************************/

19
20 package jxl.biff.formula;
21
22 import jxl.Sheet;
23
24 /**
25  * A dummy implementation used for typing information when tokens
26  * are read when parsing strings. These are then stored by the parser before
27  * being re-stored as the appropriate RPN syntactic equivalent
28  */

29 class StringParseItem extends ParseItem
30 {
31   /**
32    * Constructor
33    */

34   protected StringParseItem()
35   {
36   }
37
38   /**
39    * Gets the string representation of this item. Does nothing here
40    *
41    * @param buf
42    */

43   void getString(StringBuffer JavaDoc buf)
44   {
45   }
46
47   /**
48    * Gets the token representation of this item in RPN. Does nothing here
49    *
50    * @return the bytes applicable to this formula
51    */

52   byte[] getBytes()
53   {
54     return new byte[0];
55   }
56
57   /**
58    * Default behaviour is to do nothing
59    *
60    * @param colAdjust the amount to add on to each relative cell reference
61    * @param rowAdjust the amount to add on to each relative row reference
62    */

63   public void adjustRelativeCellReferences(int colAdjust, int rowAdjust)
64   {
65   }
66
67   /**
68    * Default behaviour is to do nothing
69    *
70    * @param sheetIndex the sheet on which the column was inserted
71    * @param col the column number which was inserted
72    * @param currentSheet TRUE if this formula is on the sheet in which the
73    * column was inserted, FALSE otherwise
74    */

75   void columnInserted(int sheetIndex, int col, boolean currentSheet)
76   {
77   }
78
79   /**
80    * Called when a column is inserted on the specified sheet. Tells
81    * the formula parser to update all of its cell references beyond this
82    * column
83    *
84    * @param sheetIndex the sheet on which the column was removed
85    * @param col the column number which was removed
86    * @param currentSheet TRUE if this formula is on the sheet in which the
87    * column was inserted, FALSE otherwise
88    */

89   void columnRemoved(int sheetIndex, int col, boolean currentSheet)
90   {
91   }
92
93   /**
94    * Called when a column is inserted on the specified sheet. Tells
95    * the formula parser to update all of its cell references beyond this
96    * column
97    *
98    * @param sheetIndex the sheet on which the row was inserted
99    * @param row the row number which was inserted
100    * @param currentSheet TRUE if this formula is on the sheet in which the
101    * column was inserted, FALSE otherwise
102    */

103   void rowInserted(int sheetIndex, int row, boolean currentSheet)
104   {
105   }
106
107   /**
108    * Called when a column is inserted on the specified sheet. Tells
109    * the formula parser to update all of its cell references beyond this
110    * column
111    *
112    * @param sheetIndex the sheet on which the row was removed
113    * @param row the row number which was removed
114    * @param currentSheet TRUE if this formula is on the sheet in which the
115    * column was inserted, FALSE otherwise
116    */

117   void rowRemoved(int sheetIndex, int row, boolean currentSheet)
118   {
119   }
120 }
121
Popular Tags