org.apache.poi.hssf.record
Class SharedValueRecordBase

java.lang.Object
  extended by org.apache.poi.hssf.record.RecordBase
      extended by org.apache.poi.hssf.record.Record
          extended by org.apache.poi.hssf.record.SharedValueRecordBase
Direct Known Subclasses:
ArrayRecord, SharedFormulaRecord, TableRecord

public abstract class SharedValueRecordBase
extends Record

Common base class for SharedFormulaRecord, ArrayRecord and TableRecord which are have similarities.

Author:
Josh Micich

Constructor Summary
protected SharedValueRecordBase()
           
protected SharedValueRecordBase(CellRangeAddress8Bit range)
           
  SharedValueRecordBase(RecordInputStream in)
          reads only the range (1 CellRangeAddress8Bit) from the stream
 
Method Summary
protected  void fillFields(RecordInputStream in)
          called by the constructor, should set class level fields.
protected abstract  int getExtraDataSize()
           
 int getFirstColumn()
           
 int getFirstRow()
           
 int getLastColumn()
           
 int getLastRow()
           
 CellRangeAddress8Bit getRange()
           
 int getRecordSize()
          gives the current serialized size of the record.
 boolean isFirstCell(int rowIx, int colIx)
           
 boolean isInRange(int rowIx, int colIx)
           
 boolean isInValueSection()
          Mirroring formula records so it is registered in the ValueRecordsAggregate
 boolean isValue()
          Register it in the ValueRecordsAggregate so it can go into the FormulaRecordAggregate
 int serialize(int offset, byte[] data)
          called by the class that is responsible for writing this sucker.
protected abstract  void serializeExtraData(int offset, byte[] data)
           
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
clone, cloneViaReserialise, getSid, serialize, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SharedValueRecordBase

protected SharedValueRecordBase(CellRangeAddress8Bit range)

SharedValueRecordBase

protected SharedValueRecordBase()

SharedValueRecordBase

public SharedValueRecordBase(RecordInputStream in)
reads only the range (1 CellRangeAddress8Bit) from the stream

Method Detail

validateSid

protected final 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.

Specified by:
validateSid in class Record
Parameters:
id - alleged id for this record

getRange

public final CellRangeAddress8Bit getRange()

getFirstRow

public final int getFirstRow()

getLastRow

public final int getLastRow()

getFirstColumn

public final int getFirstColumn()

getLastColumn

public final int getLastColumn()

getRecordSize

public final int getRecordSize()
Description copied from class: Record
gives the current serialized size of the record. Should include the sid and reclength (4 bytes).

Overrides:
getRecordSize in class Record

getExtraDataSize

protected abstract int getExtraDataSize()

serializeExtraData

protected abstract void serializeExtraData(int offset,
                                           byte[] data)

serialize

public final int serialize(int offset,
                           byte[] data)
Description copied from class: RecordBase
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.

Specified by:
serialize in class RecordBase
Parameters:
offset - to begin writing at
data - byte array containing instance data
Returns:
number of bytes written

fillFields

protected final void fillFields(RecordInputStream in)
Description copied from class: Record
called by the constructor, should set class level fields. Should throw runtime exception for bad/icomplete data.

Specified by:
fillFields in class Record
Parameters:
in - the RecordInputstream to read the record from

isInRange

public final boolean isInRange(int rowIx,
                               int colIx)
Returns:
true if (rowIx, colIx) is within the range (getRange()) of this shared value object.

isFirstCell

public final boolean isFirstCell(int rowIx,
                                 int colIx)
Returns:
true if (rowIx, colIx) describes the first cell in this shared value object's range (getRange())

isInValueSection

public final boolean isInValueSection()
Mirroring formula records so it is registered in the ValueRecordsAggregate

Overrides:
isInValueSection in class Record

isValue

public final boolean isValue()
Register it in the ValueRecordsAggregate so it can go into the FormulaRecordAggregate

Overrides:
isValue in class Record


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.