KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > read > biff > ColumnInfoRecord


1 /*********************************************************************
2 *
3 * Copyright (C) 2002 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.read.biff;
21
22 import jxl.biff.Type;
23 import jxl.biff.IntegerHelper;
24 import jxl.biff.RecordData;
25
26 /**
27  * Contains the display info data which affects the entire columns
28  */

29 public class ColumnInfoRecord extends RecordData
30 {
31   /**
32    * The raw data
33    */

34   private byte[] data;
35
36   /**
37    * The start for which to apply the format information
38    */

39   private int startColumn;
40
41   /**
42    * The end column for which to apply the format information
43    */

44   private int endColumn;
45
46   /**
47    * The index to the XF record, which applies to each cell in this column
48    */

49   private int xfIndex;
50
51   /**
52    * The width of the column in 1/256 of a character
53    */

54   private int width;
55
56   /**
57    * A hidden flag
58    */

59   private boolean hidden;
60
61   /**
62    * Constructor which creates this object from the binary data
63    *
64    * @param t the record
65    */

66   ColumnInfoRecord(Record t)
67   {
68     super(Type.COLINFO);
69
70     data = t.getData();
71
72     startColumn = IntegerHelper.getInt(data[0], data[1]);
73     endColumn = IntegerHelper.getInt(data[2], data[3]);
74     width = IntegerHelper.getInt(data[4], data[5]);
75     xfIndex = IntegerHelper.getInt(data[6], data[7]);
76
77     int options = IntegerHelper.getInt(data[8], data[9]);
78     hidden = ((options & 0x1) != 0);
79   }
80
81   /**
82    * Accessor for the start column of this range
83    *
84    * @return the start column index
85    */

86   public int getStartColumn()
87   {
88     return startColumn;
89   }
90
91   /**
92    * Accessor for the end column of this range
93    *
94    * @return the end column index
95    */

96   public int getEndColumn()
97   {
98     return endColumn;
99   }
100
101   /**
102    * Accessor for the column format index
103    *
104    * @return the format index
105    */

106   public int getXFIndex()
107   {
108     return xfIndex;
109   }
110
111   /**
112    * Accessor for the width of the column
113    *
114    * @return the width
115    */

116   public int getWidth()
117   {
118     return width;
119   }
120
121   /**
122    * Accessor for the hidden flag. Used when copying sheets
123    *
124    * @return TRUE if the columns are hidden, FALSE otherwise
125    */

126   public boolean getHidden()
127   {
128     return hidden;
129   }
130 }
131
132
133
Popular Tags