jxl.write.biff
Class RowRecord

java.lang.Object
  |
  +--jxl.biff.RecordData
        |
        +--jxl.biff.WritableRecordData
              |
              +--jxl.write.biff.RowRecord
All Implemented Interfaces:
ByteData

class RowRecord
extends WritableRecordData

Contains all the cells for a given row in a sheet


Field Summary
private  CellValue[] cells
          The cells which comprise this row
private  boolean collapsed
          Flag to indicate whether this row is outline collapsed or not
private  byte[] data
          The binary data
private static int defaultHeightIndicator
          Indicates that the row is default height
private static int growSize
          The amount to grow the cells array by
private static int maxRKValue
          The maximum integer value that can be squeezed into 30 bits
private static int minRKValue
          The minimum integer value that can be squeezed into 30 bits
private  int numColumns
          The number of columns in this row.
private  int rowHeight
          The height of this row
private  int rowNumber
          The number of this row within the worksheet
 
Fields inherited from class jxl.biff.RecordData
code, record
 
Constructor Summary
RowRecord(int rn)
          Constructs an empty row which has the specified row number
 
Method Summary
 void addCell(CellValue cv)
          Adds a cell to this row, growing the array of cells as required
(package private)  void decrementRow()
          Decrements the row of this cell by one.
 CellValue getCell(int col)
          Gets the cell which occurs at the specified column value
 byte[] getData()
          Gets the row data to output to file
 int getMaxColumn()
          Gets the maximum column value which occurs in this row
 int getRowHeight()
          Gets the height of the row
 int getRowNumber()
          Gets the row number of this row
(package private)  void incrementRow()
          Increments the row of this cell by one.
(package private)  void insertColumn(int col)
          Inserts a new column at the position specified
 boolean isCollapsed()
          Queries whether the row is collapsed
 boolean isDefaultHeight()
          Interrogates whether this row is of default height
 void removeCell(int col)
          Removes a cell from this row
(package private)  void removeColumn(int col)
          Remove the new column at the position specified
 void setCollapsed(boolean c)
          Sets the collapsed status of this row
(package private)  void setRowDetails(int height, boolean col)
          Sets the row details based upon the readable row record passed in Called when copying spreadsheets
 void setRowHeight(int h)
          Sets the height of this row
 void write(File outputFile)
          Writes out the row information data (but not the individual cells)
 void writeCells(File outputFile)
          Writes out all the cells in this row.
private  void writeIntegerValues(java.util.ArrayList integerValues, File outputFile)
          Writes out the list of integer values.
 
Methods inherited from class jxl.biff.WritableRecordData
getBytes
 
Methods inherited from class jxl.biff.RecordData
getCode, getRecord
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

data

private byte[] data
The binary data

cells

private CellValue[] cells
The cells which comprise this row

rowHeight

private int rowHeight
The height of this row

collapsed

private boolean collapsed
Flag to indicate whether this row is outline collapsed or not

rowNumber

private int rowNumber
The number of this row within the worksheet

numColumns

private int numColumns
The number of columns in this row. This is the largest column value + 1

growSize

private static final int growSize
The amount to grow the cells array by

maxRKValue

private static final int maxRKValue
The maximum integer value that can be squeezed into 30 bits

minRKValue

private static final int minRKValue
The minimum integer value that can be squeezed into 30 bits

defaultHeightIndicator

private static int defaultHeightIndicator
Indicates that the row is default height
Constructor Detail

RowRecord

public RowRecord(int rn)
Constructs an empty row which has the specified row number
Parameters:
rn - the row number of this row
Method Detail

setRowHeight

public void setRowHeight(int h)
Sets the height of this row
Parameters:
h - the row height

setRowDetails

void setRowDetails(int height,
                   boolean col)
Sets the row details based upon the readable row record passed in Called when copying spreadsheets
Parameters:
height - the height of the row record in 1/20ths of a point
the - collapsed status of the row

setCollapsed

public void setCollapsed(boolean c)
Sets the collapsed status of this row
Parameters:
c - the collapsed flag

getRowNumber

public int getRowNumber()
Gets the row number of this row
Returns:
the row number

addCell

public void addCell(CellValue cv)
Adds a cell to this row, growing the array of cells as required
Parameters:
cv - the cell to add

removeCell

public void removeCell(int col)
Removes a cell from this row
Parameters:
col - the column at which to remove the cell

write

public void write(File outputFile)
           throws java.io.IOException
Writes out the row information data (but not the individual cells)
Parameters:
outputFile - the output file
Throws:
java.io.IOException -  

writeCells

public void writeCells(File outputFile)
                throws java.io.IOException
Writes out all the cells in this row. If more than three integer values occur consecutively, then a MulRK record is used to group the numbers
Parameters:
outputFile - the output file
Throws:
java.io.IOException -  

writeIntegerValues

private void writeIntegerValues(java.util.ArrayList integerValues,
                                File outputFile)
                         throws java.io.IOException
Writes out the list of integer values. If there are more than three, a MulRK record is used, otherwise a sequence of Numbers is used
Parameters:
outputFile - the output file
integerValues - the array of integer values
Throws:
java.io.IOException -  

getData

public byte[] getData()
Gets the row data to output to file
Overrides:
getData in class WritableRecordData
Returns:
the binary data

getMaxColumn

public int getMaxColumn()
Gets the maximum column value which occurs in this row
Returns:
the maximum column value

getCell

public CellValue getCell(int col)
Gets the cell which occurs at the specified column value
Parameters:
col - the colun for which to return the cell
Returns:
the cell value at the specified position, or null if the column is invalid

incrementRow

void incrementRow()
Increments the row of this cell by one. Invoked by the sheet when inserting rows

decrementRow

void decrementRow()
Decrements the row of this cell by one. Invoked by the sheet when removing rows

insertColumn

void insertColumn(int col)
Inserts a new column at the position specified
Parameters:
col - the column to insert

removeColumn

void removeColumn(int col)
Remove the new column at the position specified
Parameters:
col - the column to remove

isDefaultHeight

public boolean isDefaultHeight()
Interrogates whether this row is of default height
Returns:
TRUE if this is set to the default height, FALSE otherwise

getRowHeight

public int getRowHeight()
Gets the height of the row
Returns:
the row height

isCollapsed

public boolean isCollapsed()
Queries whether the row is collapsed
Returns:
the collapsed indicator