| Method from org.apache.cocoon.poi.hssf.record.DBCellRecord Detail: |
public void addCellOffset(short offset) {
if (field_2_cell_offsets == null)
{
field_2_cell_offsets = new short[ 1 ];
}
else
{
short[] temp = new short[ field_2_cell_offsets.length + 1 ];
System.arraycopy(field_2_cell_offsets, 0, temp, 0,
field_2_cell_offsets.length);
field_2_cell_offsets = temp;
}
field_2_cell_offsets[ field_2_cell_offsets.length - 1 ] = offset;
}
|
protected void fillFields(byte[] data,
short size,
int offset) {
field_1_row_offset = LittleEndian.getShort(data, 0 + offset);
field_2_cell_offsets = new short[ (size - 4) / 2 ];
int element = 0;
for (int k = 4; k < data.length; k += 2)
{
field_2_cell_offsets[ element++ ] = LittleEndian.getShort(data,
k + offset);
}
}
|
public short getCellOffsetAt(int index) {
return field_2_cell_offsets[ index ];
}
return the cell offset in the array |
public int getNumCellOffsets() {
return field_2_cell_offsets.length;
}
get the number of cell offsets in the celloffset array |
public int getRowOffset() {
return field_1_row_offset;
}
gets offset from the start of this DBCellRecord to the start of the first cell in
the next DBCell block. |
public short getSid() {
return this.sid;
}
|
public boolean isInValueSection() {
return true;
}
|
public byte[] serialize() {
if (field_2_cell_offsets == null)
{
field_2_cell_offsets = new short[ 0 ];
}
byte[] retval = new byte[ 8 + (getNumCellOffsets() * 2) ];
LittleEndian.putShort(retval, 0, sid);
LittleEndian.putShort(retval, 2,
(( short ) (4 + (getNumCellOffsets() * 2))));
LittleEndian.putInt(retval, 4, getRowOffset());
for (int k = 0; k < getNumCellOffsets(); k++)
{
LittleEndian.putShort(retval, 8 + k, getCellOffsetAt(k));
}
return retval;
}
|
public void setRowOffset(int offset) {
field_1_row_offset = offset;
}
sets offset from the start of this DBCellRecord to the start of the first cell in
the next DBCell block. |
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("[DBCELL]\n");
buffer.append(" .rowoffset = ")
.append(Integer.toHexString(getRowOffset())).append("\n");
for (int k = 0; k < getNumCellOffsets(); k++)
{
buffer.append(" .cell_" + k + " = ")
.append(Integer.toHexString(getCellOffsetAt(k))).append("\n");
}
buffer.append("[/DBCELL]\n");
return buffer.toString();
}
|
protected void validateSid(short id) {
if (id != sid)
{
throw new RecordFormatException("NOT A valid DBCell RECORD");
}
}
|