Methods Summary |
---|
public void | addREFRecord(ExternSheetSubRecord rec)adds REF struct (ExternSheetSubRecord)
field_2_REF_structures.add(rec);
|
protected void | fillFields(org.apache.poi.hssf.record.RecordInputStream in)called by the constructor, should set class level fields. Should throw
runtime exception for bad/icomplete data.
field_2_REF_structures = new ArrayList();
field_1_number_of_REF_sturcutres = in.readShort();
for (int i = 0 ; i < field_1_number_of_REF_sturcutres ; ++i) {
ExternSheetSubRecord rec = new ExternSheetSubRecord(in);
field_2_REF_structures.add( rec);
}
|
public int | getNumOfREFRecords()returns the number of REF Records, which is in model
return field_2_REF_structures.size();
|
public short | getNumOfREFStructures()return the number of the REF structors , that is in Excel file
return field_1_number_of_REF_sturcutres;
|
public ExternSheetSubRecord | getREFRecordAt(int elem)returns the REF record (ExternSheetSubRecord)
ExternSheetSubRecord result = ( ExternSheetSubRecord ) field_2_REF_structures.get(elem);
return result;
|
public int | getRecordSize()
return 4 + 2 + getNumOfREFRecords() * 6;
|
public short | getSid()return the non static version of the id for this record.
return sid;
|
public int | serialize(int offset, byte[] data)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.
LittleEndian.putShort(data, 0 + offset, sid);
LittleEndian.putShort(data, 2 + offset,(short)(2 + (getNumOfREFRecords() *6)));
LittleEndian.putShort(data, 4 + offset, getNumOfREFStructures());
int pos = 6 ;
for (int k = 0; k < getNumOfREFRecords(); k++) {
ExternSheetSubRecord record = getREFRecordAt(k);
System.arraycopy(record.serialize(), 0, data, pos + offset, 6);
pos +=6;
}
return getRecordSize();
|
public void | setNumOfREFStructures(short numStruct)sets the number of the REF structors , that is in Excel file
field_1_number_of_REF_sturcutres = numStruct;
|
public java.lang.String | toString()
StringBuffer buffer = new StringBuffer();
buffer.append("[EXTERNSHEET]\n");
buffer.append(" numOfRefs = ").append(getNumOfREFStructures()).append("\n");
for (int k=0; k < this.getNumOfREFRecords(); k++) {
buffer.append("refrec #").append(k).append('\n");
buffer.append(getREFRecordAt(k).toString());
buffer.append("----refrec #").append(k).append('\n");
}
buffer.append("[/EXTERNSHEET]\n");
return buffer.toString();
|
protected void | validateSid(short id)called by constructor, should throw runtime exception in the event of a
record passed with a differing ID.
if (id != sid) {
throw new RecordFormatException("NOT An ExternSheet RECORD");
}
|