org.apache.poi.hssf.record
Class RowRecord

java.lang.Object
  |
  +--org.apache.poi.hssf.record.Record
        |
        +--org.apache.poi.hssf.record.RowRecord
All Implemented Interfaces:
java.lang.Comparable

public class RowRecord
extends Record
implements java.lang.Comparable

Title: Row Record

Description: stores the row information for the sheet.

REFERENCE: PG 379 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)

Version:
2.0-pre
Author:
Andrew C. Oliver (acoliver at apache dot org)

Field Summary
static short sid
           
 
Constructor Summary
RowRecord()
           
RowRecord(short id, short size, byte[] data)
          Constructs a Row record and sets its fields appropriately.
RowRecord(short id, short size, byte[] data, int offset)
          Constructs a Row record and sets its fields appropriately.
 
Method Summary
 int compareTo(java.lang.Object obj)
           
 boolean equals(java.lang.Object obj)
           
protected  void fillFields(byte[] data, short size, int offset)
          called by the constructor, should set class level fields.
 boolean getBadFontHeight()
          get whether the font and row height are not compatible
 boolean getColapsed()
          get whether or not to colapse this row
 short getFirstCol()
          get the logical col number for the first cell this row (0 based index)
 boolean getFormatted()
          get whether the row has been formatted (even if its got all blank cells)
 short getHeight()
          get the height of the row
 short getLastCol()
          get the logical col number for the last cell this row (0 based index)
 short getOptimize()
          get whether to optimize or not (set to 0)
 short getOptionFlags()
          gets the option bitmask.
 short getOutlineLevel()
          get the outline level of this row
 int getRecordSize()
          gives the current serialized size of the record.
 short getRowNumber()
          get the logical row number for this row (0 based index)
 short getSid()
          return the non static version of the id for this record.
 short getXFIndex()
          if the row is formatted then this is the index to the extended format record
 boolean getZeroHeight()
          get whether or not to display this row with 0 height
 boolean isInValueSection()
          DBCELL, ROW, VALUES all say yes
 int serialize(int offset, byte[] data)
          called by the class that is responsible for writing this sucker.
 void setBadFontHeight(boolean f)
          set whether the font and row height are not compatible
 void setColapsed(boolean c)
          set whether or not to colapse this row
 void setFirstCol(short col)
          set the logical col number for the first cell this row (0 based index)
 void setFormatted(boolean f)
          set whether the row has been formatted (even if its got all blank cells)
 void setHeight(short height)
          set the height of the row
 void setLastCol(short col)
          set the logical col number for the last cell this row (0 based index)
 void setOptimize(short optimize)
          set whether to optimize or not (set to 0)
 void setOptionFlags(short options)
          sets the option bitmask.
 void setOutlineLevel(short ol)
          set the outline level of this row
 void setRowNumber(short row)
          set the logical row number for this row (0 based index)
 void setXFIndex(short index)
          if the row is formatted then this is the index to the extended format record
 void setZeroHeight(boolean z)
          set whether or not to display this row with 0 height
 java.lang.String toString()
          get a string representation of the record (for biffview/debugging)
protected  void validateSid(short id)
          called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
 
Methods inherited from class org.apache.poi.hssf.record.Record
fillFields, isValue, processContinueRecord, serialize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sid

public static final short sid
Constructor Detail

RowRecord

public RowRecord()

RowRecord

public RowRecord(short id,
                 short size,
                 byte[] data)
Constructs a Row record and sets its fields appropriately.
Parameters:
id - id must be 0x208 or an exception will be throw upon validation
size - the size of the data area of the record
data - data of the record (should not contain sid/len)

RowRecord

public RowRecord(short id,
                 short size,
                 byte[] data,
                 int offset)
Constructs a Row record and sets its fields appropriately.
Parameters:
id - id must be 0x208 or an exception will be throw upon validation
size - the size of the data area of the record
data - data of the record (should not contain sid/len)
offset - of the record data
Method Detail

validateSid

protected void validateSid(short id)
Description copied from class: Record
called by constructor, should throw runtime exception in the event of a record passed with a differing ID.
Overrides:
validateSid in class Record
Following copied from class: org.apache.poi.hssf.record.Record
Parameters:
id - alleged id for this record

fillFields

protected void fillFields(byte[] data,
                          short size,
                          int offset)
Description copied from class: Record
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.
Overrides:
fillFields in class Record
Following copied from class: org.apache.poi.hssf.record.Record
Parameters:
data - raw data
size - size of data
offset - of the record's data (provided a big array of the file)

setRowNumber

public void setRowNumber(short row)
set the logical row number for this row (0 based index)
Parameters:
row - - the row number

setFirstCol

public void setFirstCol(short col)
set the logical col number for the first cell this row (0 based index)
Parameters:
col - - the col number

setLastCol

public void setLastCol(short col)
set the logical col number for the last cell this row (0 based index)
Parameters:
col - - the col number

setHeight

public void setHeight(short height)
set the height of the row
Parameters:
height - of the row

setOptimize

public void setOptimize(short optimize)
set whether to optimize or not (set to 0)
Parameters:
optimize - (set to 0)

setOptionFlags

public void setOptionFlags(short options)
sets the option bitmask. (use the individual bit setters that refer to this method)
Parameters:
options - - the bitmask

setOutlineLevel

public void setOutlineLevel(short ol)
set the outline level of this row
Parameters:
ol - - the outline level
See Also:
setOptionFlags(short)

setColapsed

public void setColapsed(boolean c)
set whether or not to colapse this row
Parameters:
c - - colapse or not
See Also:
setOptionFlags(short)

setZeroHeight

public void setZeroHeight(boolean z)
set whether or not to display this row with 0 height
Parameters:
z - height is zero or not.
See Also:
setOptionFlags(short)

setBadFontHeight

public void setBadFontHeight(boolean f)
set whether the font and row height are not compatible
Parameters:
f - true if they aren't compatible (damn not logic)
See Also:
setOptionFlags(short)

setFormatted

public void setFormatted(boolean f)
set whether the row has been formatted (even if its got all blank cells)
Parameters:
f - formatted or not
See Also:
setOptionFlags(short)

setXFIndex

public void setXFIndex(short index)
if the row is formatted then this is the index to the extended format record
Parameters:
index - to the XF record
See Also:
ExtendedFormatRecord

getRowNumber

public short getRowNumber()
get the logical row number for this row (0 based index)
Returns:
row - the row number

getFirstCol

public short getFirstCol()
get the logical col number for the first cell this row (0 based index)
Returns:
col - the col number

getLastCol

public short getLastCol()
get the logical col number for the last cell this row (0 based index)
Returns:
col - the col number

getHeight

public short getHeight()
get the height of the row
Returns:
height of the row

getOptimize

public short getOptimize()
get whether to optimize or not (set to 0)
Returns:
optimize (set to 0)

getOptionFlags

public short getOptionFlags()
gets the option bitmask. (use the individual bit setters that refer to this method)
Returns:
options - the bitmask

getOutlineLevel

public short getOutlineLevel()
get the outline level of this row
Returns:
ol - the outline level
See Also:
getOptionFlags()

getColapsed

public boolean getColapsed()
get whether or not to colapse this row
Returns:
c - colapse or not
See Also:
getOptionFlags()

getZeroHeight

public boolean getZeroHeight()
get whether or not to display this row with 0 height
Returns:
- z height is zero or not.
See Also:
getOptionFlags()

getBadFontHeight

public boolean getBadFontHeight()
get whether the font and row height are not compatible
Returns:
- f -true if they aren't compatible (damn not logic)
See Also:
getOptionFlags()

getFormatted

public boolean getFormatted()
get whether the row has been formatted (even if its got all blank cells)
Returns:
formatted or not
See Also:
getOptionFlags()

getXFIndex

public short getXFIndex()
if the row is formatted then this is the index to the extended format record
Returns:
index to the XF record or bogus value (undefined) if isn't formatted
See Also:
ExtendedFormatRecord

isInValueSection

public boolean isInValueSection()
Description copied from class: Record
DBCELL, ROW, VALUES all say yes
Overrides:
isInValueSection in class Record

toString

public java.lang.String toString()
Description copied from class: Record
get a string representation of the record (for biffview/debugging)
Overrides:
toString in class Record

serialize

public int serialize(int offset,
                     byte[] data)
Description copied from class: Record
called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.
Overrides:
serialize in class Record
Following copied from class: org.apache.poi.hssf.record.Record
Parameters:
offset - to begin writing at
data - byte array containing instance data
Returns:
number of bytes written

getRecordSize

public int getRecordSize()
Description copied from class: Record
gives the current serialized size of the record.
Overrides:
getRecordSize in class Record

getSid

public short getSid()
Description copied from class: Record
return the non static version of the id for this record.
Overrides:
getSid in class Record

compareTo

public int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2002 Apache jakarta-poi project. All Rights Reserved.