}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != getSid())
- {
- throw new RecordFormatException("Not an escher record! (sid was " + id + ", expecting " + getSid() + ")");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
escherRecords = new ArrayList();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a AreaFormat record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_foregroundColor = in.readInt();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Area record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a AxisLineFormat record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_axisType = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a AxisOptions record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_minimumCategory = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a AxisParent record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_axisType = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Axis record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_axisType = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a AxisUsed record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_numAxis = in.readShort();
// fillFields(data,size);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A BOF RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_version = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A BACKUP RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_backup = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Bar record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_barSpace = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A BEGIN RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
}
field_3_xf = in.readShort();
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A BLANKRECORD!");
- }
- }
-
/**
* set the row this cell occurs on
* @param row the row this cell occurs within
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A BOOKBOOL RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_save_link_values = in.readShort();
return 12;
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
- protected void validateSid(short id)
- {
- if (id != BoolErrRecord.sid)
- {
- throw new RecordFormatException("Not a valid BoolErrRecord");
- }
- }
-
public short getSid()
{
return sid;
super( in );
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid( short id )
- {
- if ( id != sid )
- {
- throw new RecordFormatException( "Not a BottomMargin record" );
- }
- }
-
protected void fillFields( RecordInputStream in )
{
field_1_margin = in.readDouble();
return rec;
}
-} // END OF CLASS
+} // END OF CLASS
\ No newline at end of file
super(in);
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT A Bound Sheet RECORD");
- }
- }
-
/**
* UTF8: sid + len + bof + flags + len(str) + unicode + str 2 + 2 + 4 + 2 +
* 1 + 1 + len(str)
return 4 + getDataSize();
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
-
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException(
- "NOT A ConditionalFormattingHeaderRecord RECORD");
- }
- }
-
public short getSid()
{
return sid;
public void setParsedExpression2(Ptg[] ptgs) {
field_18_formula2 = safeClone(ptgs);
}
-
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
-
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A CFRULE RECORD");
- }
- }
public short getSid()
{
super(in);
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT An XCT RECORD");
- }
- }
-
public int getNumberOfCRNs() {
return field_1_number_crn_records;
}
super(in);
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT An XCT RECORD");
- }
- }
-
public int getNumberOfCRNs() {
return field_1_last_column_index;
}
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An Calc Count RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_iterations = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An Calc Mode RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_calcmode = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a CategorySeriesAxis record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_crossingPoint = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A CHARTFORMAT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field1_x_position = in.readInt();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Chart record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_x = in.readInt();
super(in);
}
- protected void validateSid(short id) {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A CHARTTITLEFORMAT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in) {
m_recs = in.readUShort();
int idx;
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A CODEPAGE RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_codepage = in.readShort();
}
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A COLINFO RECORD!!");
- }
- }
-
/**
* set the first column this record defines formatting info for
* @param fc - the first column index (0-based)
super(in);
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a CommonObjectData record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_objectType = in.readShort();
return field_1_data;
}
- /**
- * Make sure we have a good id
- *
- * @param id the alleged id
- */
-
- protected void validateSid(short id)
- {
- if (id != ContinueRecord.sid)
- {
- throw new RecordFormatException("Not a Continue Record");
- }
- }
-
/**
* Debugging toString
*
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A Country RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_default_country = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A valid DBCell RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_row_offset = in.readUShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A DSF RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_dsf = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A valid DVAL RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
this.field_1_options = in.readShort();
_regions = regions;
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT a valid DV RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in) {
_option_flags = in.readInt();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Dat record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_options = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a DataFormat record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_pointNumber = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A 1904 RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_window = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A DefaultColWidth RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_col_width = in.readUShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a DefaultDataLabelTextProperties record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_categoryDataType = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A DefaultRowHeight RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_option_flags = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A DELTA RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_max_change = in.readDouble();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A valid DIMENSIONS RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_first_row = in.readInt();
super( in );
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a MSODRAWING record");
- }
- }
-
protected void fillFields( RecordInputStream in )
{
recordData = in.readRemainder();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An EOF RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
}
super(in);
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a EmbeddedObjectRef record");
- }
- }
-
public short getSid()
{
return sid;
super(in);
}
-
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An END RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
}
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a End record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
}
super(in);
}
- protected void validateSid(short id)
- {
-
- // do nothing
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_stream_pos = in.readInt();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An EXTSST RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_2_sst_info = new ArrayList();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A EXTENDED FORMAT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_font_index = in.readShort();
super(in);
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT An ExternSheet RECORD");
- }
- }
-
/**
* called by the constructor, should set class level fields. Should throw
* runtime exception for bad/icomplete data.
return field_4_name;
}
-
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT A valid ExternalName RECORD");
- }
- }
-
private int getDataSize(){
int result = 3 * 2 // 3 short fields
+ 2 + field_4_name.length(); // nameLen and name
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A FILEPASS RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_encryptedpassword = in.readInt();
super(in);
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT A FILESHARING RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in) {
field_1_readonly = in.readShort();
field_2_password = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A FNGROUPCOUNT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_count = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a FontBasis record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_xBasis = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a FontIndex record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_fontIndex = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A FONT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_font_height = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A FooterRECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
if (in.remaining() > 0)
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A FORMAT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_index_code = in.readShort();
field_8_parsed_expr = ptgs;
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT A FORMULA RECORD");
- }
- }
-
public short getSid() {
return sid;
}
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Frame record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_borderType = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A Gridset RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_gridset_flag = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Group Marker record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
// int pos = 0;
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A Guts RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_left_row_gutter = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A HCenter RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_hcenter = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A HEADERRECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
if (in.remaining() > 0)
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A HIDEOBJ RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_hide_obj = in.readShort();
super(in);
}
- protected void validateSid(short id) {
- if (id != getSid()) {
- throw new RecordFormatException(
- "NOT A HorizontalPageBreak or VerticalPageBreak RECORD!! " + id);
- }
- }
-
public short getSid() {
return sid;
}
return HyperlinkRecord.sid;
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A HYPERLINKRECORD!");
- }
- }
-
public int serialize(int offset, byte[] data)
{
int pos = offset;
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An Index RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_5_dbcells =
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A INTERFACEEND RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
}
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A INTERFACEHDR RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_codepage = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An ITERATION RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_iteration = in.readShort();
super(in);
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a valid LabelRecord");
- }
- }
-
/**
* @param in the RecordInputstream to read the record from
*/
super(in);
}
-
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A valid LabelSST RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_row = in.readUShort();
public LeftMarginRecord(RecordInputStream in)
{ super(in); }
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid( short id )
- {
- if ( id != sid )
- {
- throw new RecordFormatException( "Not a LeftMargin record" );
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_margin = in.readDouble();
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLASS
+} // END OF CLASS
\ No newline at end of file
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Legend record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_xAxisUpperLeft = in.readInt();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a LineFormat record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_lineColor = in.readInt();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a LinkedData record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_linkType = in.readByte();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A MMS RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_addMenuCount = in.readByte();
return retval.toString();
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT A MERGEDCELLS RECORD!! "
- + id);
- }
- }
-
public Object clone() {
int nRegions = _numberOfRegions;
CellRangeAddress[] clonedRegions = new CellRangeAddress[nRegions];
return buffer.toString();
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
-
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a MulBlankRecord!");
- }
- }
-
public short getSid()
{
return sid;
return buffer.toString();
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
-
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a MulRKRecord!");
- }
- }
-
public short getSid()
{
return sid;
return field_17_status_bar_text;
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT A valid Name RECORD");
- }
- }
-
/**
* called by the class that is responsible for writing this sucker.
return sid;
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a NoteRecord record");
- }
- }
-
/**
* Read the record data from the supplied <code>RecordInputStream</code>
*/
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Note Structure record");
- }
- }
-
/**
* Read the record data from the supplied <code>RecordInputStream</code>
*/
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a NumberFormatIndex record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_formatIndex = in.readShort();
return 18;
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
-
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A Number RECORD");
- }
- }
-
public short getSid()
{
return sid;
super(in);
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not an OBJ record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
// TODO - problems with OBJ sub-records stream
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a ObjectLink record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_anchorId = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT AN OBJECTPROTECT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An Palette RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_numcolors = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Pane record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_x = in.readShort();
super(in);
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT A PASSWORD RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in) {
field_1_password = in.readShort();
}
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A PROT4REVPASSWORD RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_password = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a PlotArea record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a PlotGrowth record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_horizontalScale = in.readInt();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A PRECISION RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_precision = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A PrintGridlines RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_print_gridlines = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A PrintHeaders RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_print_headers = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException(
- "NOT A valid PrintSetup record RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_paper_size = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A PROTECT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A PROTECTION REV 4 RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A valid RK RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_row = in.readUShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A RECALCID RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_recalcids = new short[ in.remaining() / 2 ];
*/
protected Record(RecordInputStream in)
{
- validateSid(in.getSid());
fillFields(in);
}
- /**
- * called by constructor, should throw runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
-
- protected abstract void validateSid(short id);
-
/**
* called by the constructor, should set class level fields. Should throw
* runtime exception for bad/icomplete data.
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT An RefMode RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_mode = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A REFRESHALL RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_refreshall = in.readShort();
public RightMarginRecord( RecordInputStream in )
{ super( in ); }
- /**
- * Checks the sid matches the expected side for this record * * @param id the expected sid.
- */
- protected void validateSid( short id )
- {
- if ( id != sid )
- {
- throw new RecordFormatException( "Not a RightMargin record" );
- }
- }
-
protected void fillFields( RecordInputStream in )
{
field_1_margin = in.readDouble();
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLASS
\ No newline at end of file
+} // END OF CLAS
\ No newline at end of file
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A valid ROW RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_row_number = in.readUShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a SCL record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_numerator = in.readShort();
.equals( other.field_3_strings ) );
}
- /**
- * validate SID
- *
- * @param id the alleged SID
- *
- * @exception RecordFormatException if validation fails
- */
-
- protected void validateSid( final short id )
- throws RecordFormatException
- {
- if ( id != sid )
- {
- throw new RecordFormatException( "NOT An SST RECORD" );
- }
- }
-
/**
* Fill the fields from the data
* <P>
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A Save Recalc RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_recalc = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A SCENARIOPROTECT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
super(in);
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT A valid Selection RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in) {
field_1_pane = in.readByte();
field_2_row_active_cell = in.readUShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a SeriesChartGroupIndex record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_chartGroupIndex = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a SeriesIndex record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_index = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a SeriesLabels record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_formatFlags = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a SeriesList record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_seriesNumbers = in.readShortArray();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Series record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_categoryDataType = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a SeriesText record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_id = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a SeriesToChartGroup record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_chartGroupIndex = in.readShort();
_range = new CellRangeAddress8Bit(in);
}
- protected final void validateSid(short id) {
- if (id != getSid()) {
- throw new RecordFormatException("Not a valid SharedFormula");
- }
- }
-
public final CellRangeAddress8Bit getRange() {
return _range;
}
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a SheetProperties record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_flags = in.readShort();
super(in);
}
-
- /**
- * Throw a runtime exception in the event of a
- * record passed with a differing ID.
- *
- * @param id alleged id for this record
- */
- protected void validateSid( short id )
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a valid StringRecord");
- }
- }
-
/**
* @param in the RecordInputstream to read the record from
*/
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A STYLE RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_xf_index = in.readShort();
super(in);
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT An ExternSheet RECORD");
- }
- }
-
public boolean isExternalReferences() {
return field_3_sheet_names != null;
}
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A TABID RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_tabids = new short[ in.remaining() / 2 ];
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a TextObjectBase record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_options = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Text record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_horizontalAlignment = in.readByte();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Tick record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
public TopMarginRecord( RecordInputStream in )
{ super( in ); }
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid( short id )
- {
- if ( id != sid )
- {
- throw new RecordFormatException( "Not a TopMargin record" );
- }
- }
-
/**
* @param in the RecordInputstream to read the record from
*/
rec.field_1_margin = this.field_1_margin;
return rec;
}
-} // END OF CLASS
+} // END OF CLASS
\ No newline at end of file
return sid;
}
- protected void validateSid(short id) {
- if (id != sid) {
- throw new RecordFormatException("NOT AN UNCALCED RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in) {
short unused = in.readShort();
}
public UnicodeString(RecordInputStream in)
{
- validateSid(in.getSid());
- fillFields(in);
+ fillFields(in); // TODO - inline
}
return true;
}
- /**
- * NO OP
- */
-
- protected void validateSid(short id)
- {
-
- // included only for interface compliance
- }
-
/**
* @param in the RecordInputstream to read the record from
*/
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a Units record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_units = in.readShort();
return 4 + _rawData.length;
}
- /**
- * NO OP!
- */
- protected void validateSid(short id) {
- // if we had a valid sid we wouldn't be using the "Unknown Record" record now would we?
- }
-
/**
* print a sort of string representation ([UNKNOWN RECORD] id = x [/UNKNOWN RECORD])
*/
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A UseSelFS RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_flag = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A VCenter RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_vcenter = in.readShort();
}
- /**
- * Checks the sid matches the expected side for this record
- *
- * @param id the expected sid.
- */
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("Not a ValueRange record");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_minimumAxisValue = in.readDouble();
super(in);
}
- protected void validateSid(short id) {
- if (id != getSid()) {
- throw new RecordFormatException(
- "NOT A HorizontalPageBreak or VerticalPageBreak RECORD!! " + id);
- }
- }
-
public short getSid() {
return sid;
}
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A WSBoolRECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
byte data[] = in.readRemainder();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A WINDOW1 RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_h_hold = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A WINDOWPROTECT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
field_1_protect = in.readShort();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A valid WindowTwo RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
int size = in.remaining();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A WRITEACCESS RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
byte[] data = in.readRemainder();
super(in);
}
- protected void validateSid(short id)
- {
- if (id != sid)
- {
- throw new RecordFormatException("NOT A WRITEPROTECT RECORD");
- }
- }
-
protected void fillFields(RecordInputStream in)
{
}
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestAreaFormatRecord
- extends TestCase
-{
+public final class TestAreaFormatRecord extends TestCase {
byte[] data = new byte[] {
(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0x00, // forecolor
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, // backcolor
};
- public TestAreaFormatRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
AreaFormatRecord record = new AreaFormatRecord(new TestcaseRecordInputStream((short)0x100a, (short)data.length, data));
assertEquals( 0xFFFFFF, record.getForegroundColor());
assertEquals( 20, record.getRecordSize() );
-
- record.validateSid((short)0x100a);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestAreaRecord
- extends TestCase
-{
+public final class TestAreaRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x02,(byte)0x00 // format flags
};
- public TestAreaRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
AreaRecord record = new AreaRecord(new TestcaseRecordInputStream((short)0x101A, (short)data.length, data));
assertEquals( 2, record.getFormatFlags());
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x101A);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestAxisLineFormatRecord
- extends TestCase
-{
+public final class TestAxisLineFormatRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x01,(byte)0x00
};
- public TestAxisLineFormatRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
AxisLineFormatRecord record = new AxisLineFormatRecord(new TestcaseRecordInputStream((short)0x1021, (short)data.length, data));
assertEquals( AxisLineFormatRecord.AXIS_TYPE_MAJOR_GRID_LINE, record.getAxisType());
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x1021);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver(acoliver at apache.org)
*/
-public class TestAxisOptionsRecord
- extends TestCase
-{
+public final class TestAxisOptionsRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00,
(byte)0x00,(byte)0xEF,(byte)0x00
};
- public TestAxisOptionsRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
AxisOptionsRecord record = new AxisOptionsRecord(new TestcaseRecordInputStream((short)0x1062, (short)data.length, data));
assertEquals( 0, record.getMinimumCategory());
assertEquals( 0, record.getMaximumCategory());
assertEquals( true, record.isDefaultCross() );
assertEquals( true, record.isDefaultDateSettings() );
-
assertEquals( 22, record.getRecordSize() );
-
- record.validateSid((short)0x1062);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestAxisParentRecord
- extends TestCase
-{
+public final class TestAxisParentRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00, // axis type
(byte)0x1D,(byte)0x02,(byte)0x00,(byte)0x00, // x
(byte)0x56,(byte)0x0B,(byte)0x00,(byte)0x00 // height
};
- public TestAxisParentRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
AxisParentRecord record = new AxisParentRecord(new TestcaseRecordInputStream((short)0x1041, (short)data.length, data));
assertEquals( AxisParentRecord.AXIS_TYPE_MAIN, record.getAxisType());
assertEquals( 0x021d, record.getX());
assertEquals( 0x0b31, record.getWidth());
assertEquals( 0x0b56, record.getHeight());
-
assertEquals( 22, record.getRecordSize() );
-
- record.validateSid((short)0x1041);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestAxisRecord
- extends TestCase
-{
+public final class TestAxisRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00, // type
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00
-
};
- public TestAxisRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
AxisRecord record = new AxisRecord(new TestcaseRecordInputStream((short)0x101d, (short)data.length, data));
assertEquals( AxisRecord.AXIS_TYPE_CATEGORY_OR_X_AXIS, record.getAxisType());
assertEquals( 0, record.getReserved3());
assertEquals( 0, record.getReserved4());
-
assertEquals( 4 + 18, record.getRecordSize() );
-
- record.validateSid((short)0x101d);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestAxisUsedRecord
- extends TestCase
-{
+public final class TestAxisUsedRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x01,(byte)0x00,
};
- public TestAxisUsedRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
AxisUsedRecord record = new AxisUsedRecord(new TestcaseRecordInputStream((short)0x1046, (short)data.length, data));
assertEquals( 1, record.getNumAxis());
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x1046);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestBarRecord
- extends TestCase
-{
+public final class TestBarRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00, // bar space
(byte)0x96,(byte)0x00, // category space
(byte)0x00,(byte)0x00 // format flags
};
- public TestBarRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
BarRecord record = new BarRecord(new TestcaseRecordInputStream((short)0x1017, (short)data.length, data));
assertEquals( 0, record.getBarSpace());
assertEquals( false, record.isDisplayAsPercentage() );
assertEquals( false, record.isShadow() );
-
assertEquals( 10, record.getRecordSize() );
-
- record.validateSid((short)0x1017);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestCategorySeriesAxisRecord
- extends TestCase
-{
+public final class TestCategorySeriesAxisRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x01,(byte)0x00, // crossing point
(byte)0x01,(byte)0x00, // label frequency
(byte)0x01,(byte)0x00 // options
};
- public TestCategorySeriesAxisRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
CategorySeriesAxisRecord record = new CategorySeriesAxisRecord(new TestcaseRecordInputStream((short)0x1020, (short)data.length, data));
assertEquals( 1, record.getCrossingPoint());
assertEquals( false, record.isCrossesFarRight() );
assertEquals( false, record.isReversed() );
-
assertEquals( 4 + 8, record.getRecordSize() );
-
- record.validateSid((short)0x1020);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestChartRecord
- extends TestCase
-{
+public final class TestChartRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,
(byte)0xC8,(byte)0xCC,(byte)0xE5,(byte)0x00
};
- public TestChartRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
ChartRecord record = new ChartRecord(new TestcaseRecordInputStream((short)0x1002, (short)data.length, data));
assertEquals( 0, record.getX());
assertEquals( 30474216, record.getWidth());
assertEquals( 15060168, record.getHeight());
-
assertEquals( 20, record.getRecordSize() );
-
- record.validateSid((short)0x1002);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestCommonObjectDataSubRecord
- extends TestCase
-{
+public final class TestCommonObjectDataSubRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x12,(byte)0x00,(byte)0x01,(byte)0x00,
(byte)0x01,(byte)0x00,(byte)0x11,(byte)0x60,
(byte)0x00,(byte)0x00,
};
- public TestCommonObjectDataSubRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
CommonObjectDataSubRecord record = new CommonObjectDataSubRecord(new TestcaseRecordInputStream((short)0x15, (short)data.length, data));
-
assertEquals( CommonObjectDataSubRecord.OBJECT_TYPE_LIST_BOX, record.getObjectType());
assertEquals( (short)1, record.getObjectId());
assertEquals( (int)218103808, record.getReserved2());
assertEquals( (int)294, record.getReserved3());
assertEquals( 22 , record.getRecordSize() );
-
- record.validateSid((short)0x15);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestDatRecord
- extends TestCase
-{
+public final class TestDatRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x0D,(byte)0x00 // options
};
- public TestDatRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
DatRecord record = new DatRecord(new TestcaseRecordInputStream((short)0x1063, (short)data.length, data));
assertEquals( 0xD, record.getOptions());
assertEquals( true, record.isBorder() );
assertEquals( true, record.isShowSeriesKey() );
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x1063);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestDataFormatRecord
- extends TestCase
-{
+public final class TestDataFormatRecord extends TestCase {
byte[] data = new byte[] {
(byte)0xFF,(byte)0xFF, // point number
(byte)0x00,(byte)0x00, // series index
(byte)0x00,(byte)0x00 // format flags
};
- public TestDataFormatRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
DataFormatRecord record = new DataFormatRecord(new TestcaseRecordInputStream((short)0x1006, (short)data.length, data));
assertEquals( (short)0xFFFF, record.getPointNumber());
assertEquals( 0, record.getFormatFlags());
assertEquals( false, record.isUseExcel4Colors() );
-
assertEquals( 12, record.getRecordSize() );
-
- record.validateSid((short)0x1006);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestDefaultDataLabelTextPropertiesRecord
- extends TestCase
-{
+public final class TestDefaultDataLabelTextPropertiesRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x02,(byte)0x00
};
- public TestDefaultDataLabelTextPropertiesRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
DefaultDataLabelTextPropertiesRecord record = new DefaultDataLabelTextPropertiesRecord(new TestcaseRecordInputStream((short)0x1024, (short)data.length, data));
assertEquals( 2, record.getCategoryDataType());
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x1024);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestEndSubRecord
- extends TestCase
-{
+public final class TestEndSubRecord extends TestCase {
byte[] data = new byte[] {
};
- public TestEndSubRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
EndSubRecord record = new EndSubRecord(new TestcaseRecordInputStream((short)0x00, (short)data.length, data));
-
-
assertEquals( 4, record.getRecordSize() );
-
- record.validateSid((short)0x00);
}
public void testStore()
0xC0-256, 0x20 // Fill Palette 20c0
};
- public TestExtendedFormatRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
ExtendedFormatRecord record = new ExtendedFormatRecord(new TestcaseRecordInputStream((short)0xe0, (short)data.length, data));
assertEquals(0, record.getFontIndex());
assertEquals(0, record.getFormatIndex());
assertEquals(0x20c0, record.getFillPaletteOptions());
assertEquals( 20 + 4, record.getRecordSize() );
- record.validateSid((short)0xe0);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestFontBasisRecord
- extends TestCase
-{
+public final class TestFontBasisRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x28,(byte)0x1A, // x basis
(byte)0x9C,(byte)0x0F, // y basis
(byte)0x05,(byte)0x00 // index to font table
};
- public TestFontBasisRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
FontBasisRecord record = new FontBasisRecord(new TestcaseRecordInputStream((short)0x1060, (short)data.length, data));
assertEquals( 0x1a28, record.getXBasis());
assertEquals( 0x00, record.getScale());
assertEquals( 0x05, record.getIndexToFontTable());
-
assertEquals( 14, record.getRecordSize() );
-
- record.validateSid((short)0x1060);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestFontIndexRecord
- extends TestCase
-{
+public final class TestFontIndexRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x05,(byte)0x00
};
- public TestFontIndexRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
FontIndexRecord record = new FontIndexRecord(new TestcaseRecordInputStream((short)0x1026, (short)data.length, data));
assertEquals( 5, record.getFontIndex());
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x1026);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
* class works correctly. Test data taken directly from a real
* Excel file.
*/
-public class TestFontRecord
- extends TestCase
-{
+public final class TestFontRecord extends TestCase {
byte[] header = new byte[] {
0x31, 00, 0x1a, 00, // sid=31, 26 bytes long
};
0x00, 0x61, 0x00, 0x6C, 0x00
};
- public TestFontRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
FontRecord record = new FontRecord(new TestcaseRecordInputStream((short)0x31, (short)data.length, data));
assertEquals( 0xc8, record.getFontHeight());
assertEquals( 26 + 4, record.getRecordSize() );
- record.validateSid((short)0x31);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestFrameRecord
- extends TestCase
-{
+public final class TestFrameRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00, // border type
(byte)0x02,(byte)0x00 // options
};
- public TestFrameRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
FrameRecord record = new FrameRecord(new TestcaseRecordInputStream((short)0x1032, (short)data.length, data));
assertEquals( FrameRecord.BORDER_TYPE_REGULAR, record.getBorderType());
assertEquals( false, record.isAutoSize() );
assertEquals( true, record.isAutoPosition() );
-
assertEquals( 8, record.getRecordSize() );
-
- record.validateSid((short)0x1032);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class TestLegendRecord
- extends TestCase
-{
+public class TestLegendRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x76,(byte)0x0E,(byte)0x00,(byte)0x00,(byte)0x86,(byte)0x07,(byte)0x00,(byte)0x00,(byte)0x19,(byte)0x01,(byte)0x00,(byte)0x00,(byte)0x8B,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x03,(byte)0x01,(byte)0x1F,(byte)0x00
};
- public TestLegendRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
LegendRecord record = new LegendRecord(new TestcaseRecordInputStream((short)0x1015, (short)data.length, data));
assertEquals( 24, record.getRecordSize() );
-
- record.validateSid((short)0x1015);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestLineFormatRecord
- extends TestCase
-{
+public class TestLineFormatRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, // colour
(byte)0x00,(byte)0x00, // pattern
(byte)0x4D,(byte)0x00 // index
};
- public TestLineFormatRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
LineFormatRecord record = new LineFormatRecord(new TestcaseRecordInputStream((short)0x1007, (short)data.length, data));
assertEquals( 0, record.getLineColor());
assertEquals( 0, record.getLinePattern());
assertEquals( false, record.isDrawTicks() );
assertEquals( 0x4d, record.getColourPaletteIndex());
-
assertEquals( 16, record.getRecordSize() );
-
- record.validateSid((short)0x1007);
}
public void testStore()
assertEquals(ptgExpected.toString(), ptgActual.toString());
assertEquals( data.length + 4, record.getRecordSize() );
-
- record.validateSid((short)0x1051);
-
}
public void testStore() {
0x6E, 0x64, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x00
};
- public TestNoteRecord(String name)
- {
- super(name);
- }
-
- public void testRead()
- throws Exception
- {
+ public void testRead() {
NoteRecord record = new NoteRecord(new TestcaseRecordInputStream(NoteRecord.sid, (short)data.length, data));
assertEquals(NoteRecord.sid, record.getSid());
- record.validateSid(NoteRecord.sid);
assertEquals(6, record.getRow());
assertEquals(1, record.getColumn());
assertEquals(NoteRecord.NOTE_VISIBLE, record.getFlags());
}
- public void testWrite()
- {
+ public void testWrite() {
NoteRecord record = new NoteRecord();
assertEquals(NoteRecord.sid, record.getSid());
- record.validateSid(NoteRecord.sid);
record.setRow((short)6);
record.setColumn((short)1);
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
+
package org.apache.poi.hssf.record;
*
* @author Yegor Kozlov
*/
-public class TestNoteStructureSubRecord
- extends TestCase
-{
+public final class TestNoteStructureSubRecord extends TestCase {
private byte[] data = new byte[] {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0x80, 0x00, 0x00, 0x00,
0x00, 0x00, (byte)0xBF, 0x00, 0x00, 0x00, 0x00, 0x00, (byte)0x81, 0x01,
(byte)0xCC, (byte)0xEC
};
- public TestNoteStructureSubRecord(String name)
- {
- super(name);
- }
-
- public void testRead()
- throws Exception
- {
+ public void testRead() {
NoteStructureSubRecord record = new NoteStructureSubRecord(new TestcaseRecordInputStream(NoteStructureSubRecord.sid, (short)data.length, data));
assertEquals(NoteStructureSubRecord.sid, record.getSid());
- record.validateSid(NoteStructureSubRecord.sid);
assertEquals(data.length + 4, record.getRecordSize());
-
}
- public void testWrite()
- {
+ public void testWrite() {
NoteStructureSubRecord record = new NoteStructureSubRecord();
assertEquals(NoteStructureSubRecord.sid, record.getSid());
- record.validateSid(NoteStructureSubRecord.sid);
assertEquals(data.length + 4, record.getRecordSize());
byte [] ser = record.serialize();
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestNumberFormatIndexRecord
- extends TestCase
-{
+public final class TestNumberFormatIndexRecord extends TestCase {
byte[] data = new byte[] {
0x05,0x00
};
- public TestNumberFormatIndexRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
NumberFormatIndexRecord record = new NumberFormatIndexRecord(new TestcaseRecordInputStream((short)0x104e, (short)data.length, data));
assertEquals( 5, record.getFormatIndex());
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x104e);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class TestObjectLinkRecord
- extends TestCase
-{
+public final class TestObjectLinkRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x03,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00
};
- public TestObjectLinkRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
ObjectLinkRecord record = new ObjectLinkRecord(new TestcaseRecordInputStream((short)0x1027, (short)data.length, data));
-
assertEquals( (short)3, record.getAnchorId());
-
assertEquals( (short)0x00, record.getLink1());
-
assertEquals( (short)0x00, record.getLink2());
-
assertEquals( 10, record.getRecordSize() );
-
- record.validateSid((short)0x1027);
}
- public void testStore()
- {
+ public void testStore() {
ObjectLinkRecord record = new ObjectLinkRecord();
-
-
record.setAnchorId( (short)3 );
-
record.setLink1( (short)0x00 );
-
record.setLink2( (short)0x00 );
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestPaneRecord
- extends TestCase
-{
+public final class TestPaneRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x01, (byte)0x00,
(byte)0x02, (byte)0x00,
(byte)0x02, (byte)0x00,
};
- public TestPaneRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
PaneRecord record = new PaneRecord(new TestcaseRecordInputStream((short)0x41, (short)data.length, data));
-
assertEquals( (short)1, record.getX());
assertEquals( (short)2, record.getY());
assertEquals( PaneRecord.ACTIVE_PANE_LOWER_LEFT, record.getActivePane());
assertEquals( 14, record.getRecordSize() );
-
- record.validateSid((short)0x41);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class TestPlotAreaRecord
- extends TestCase
-{
+public final class TestPlotAreaRecord extends TestCase {
byte[] data = new byte[] {
};
- public TestPlotAreaRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
PlotAreaRecord record = new PlotAreaRecord(new TestcaseRecordInputStream((short)0x1035, (short)data.length, data));
-
-
assertEquals( 4, record.getRecordSize() );
-
- record.validateSid((short)0x1035);
}
- public void testStore()
- {
+ public void testStore() {
PlotAreaRecord record = new PlotAreaRecord();
-
-
-
byte [] recordBytes = record.serialize();
assertEquals(recordBytes.length - 4, data.length);
for (int i = 0; i < data.length; i++)
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestPlotGrowthRecord
- extends TestCase
-{
+public final class TestPlotGrowthRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00, // horizontal
(byte)0x00,(byte)0x00,(byte)0x01,(byte)0x00 // vertical
};
- public TestPlotGrowthRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
PlotGrowthRecord record = new PlotGrowthRecord(new TestcaseRecordInputStream((short)0x1064, (short)data.length, data));
assertEquals( 65536, record.getHorizontalScale());
assertEquals( 65536, record.getVerticalScale());
-
assertEquals( 12, record.getRecordSize() );
-
- record.validateSid((short)0x1064);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class TestSCLRecord
- extends TestCase
-{
+public final class TestSCLRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x3,(byte)0x0,(byte)0x4,(byte)0x0
};
- public TestSCLRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SCLRecord record = new SCLRecord(new TestcaseRecordInputStream((short)0xa0, (short)data.length, data));
assertEquals( 3, record.getNumerator());
assertEquals( 4, record.getDenominator());
-
assertEquals( 8, record.getRecordSize() );
-
- record.validateSid((short)0xa0);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestSeriesChartGroupIndexRecord
- extends TestCase
-{
+public final class TestSeriesChartGroupIndexRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00
};
- public TestSeriesChartGroupIndexRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SeriesChartGroupIndexRecord record = new SeriesChartGroupIndexRecord(new TestcaseRecordInputStream((short)0x1045, (short)data.length, data));
assertEquals( 0, record.getChartGroupIndex());
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x1045);
-
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class TestSeriesIndexRecord
- extends TestCase
-{
+public final class TestSeriesIndexRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x03,(byte)0x00
};
- public TestSeriesIndexRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SeriesIndexRecord record = new SeriesIndexRecord(new TestcaseRecordInputStream((short)0x1065, (short)data.length, data));
-
assertEquals( (short)3, record.getIndex());
-
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x1065);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestSeriesLabelsRecord
- extends TestCase
-{
+public final class TestSeriesLabelsRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x03,(byte)0x00
};
- public TestSeriesLabelsRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SeriesLabelsRecord record = new SeriesLabelsRecord(new TestcaseRecordInputStream((short)0x100c, (short)data.length, data));
assertEquals( 3, record.getFormatFlags());
assertEquals( true, record.isShowActual() );
assertEquals( 2+4, record.getRecordSize() );
-
- record.validateSid((short)0x100c);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestSeriesListRecord
- extends TestCase
-{
+public final class TestSeriesListRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x02,(byte)0x00,(byte)0x01,(byte)0x20,(byte)0xff,(byte)0xf0
};
- public TestSeriesListRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SeriesListRecord record = new SeriesListRecord(new TestcaseRecordInputStream((short)0x1016, (short)data.length, data));
assertEquals( (short)0x2001, record.getSeriesNumbers()[0]);
assertEquals( 2, record.getSeriesNumbers().length);
assertEquals( 4 + 6, record.getRecordSize() );
-
- record.validateSid((short)0x1016);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestSeriesRecord
- extends TestCase
-{
+public final class TestSeriesRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x01,(byte)0x00, // category data type
(byte)0x01,(byte)0x00, // values data type
(byte)0x00,(byte)0x00 // num bubble values
};
- public TestSeriesRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SeriesRecord record = new SeriesRecord(new TestcaseRecordInputStream((short)0x1003, (short)data.length, data));
assertEquals( SeriesRecord.CATEGORY_DATA_TYPE_NUMERIC, record.getCategoryDataType());
assertEquals( 16, record.getRecordSize() );
-
- record.validateSid((short)0x1003);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class TestSeriesTextRecord
- extends TestCase
-{
+public final class TestSeriesTextRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00,(byte)0x0C,(byte)0x01,(byte)0x56,(byte)0x00,(byte)0x61,(byte)0x00,(byte)0x6C,(byte)0x00,(byte)0x75,(byte)0x00,(byte)0x65,(byte)0x00,(byte)0x20,(byte)0x00,(byte)0x4E,(byte)0x00,(byte)0x75,(byte)0x00,(byte)0x6D,(byte)0x00,(byte)0x62,(byte)0x00,(byte)0x65,(byte)0x00,(byte)0x72,(byte)0x00
};
- public TestSeriesTextRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SeriesTextRecord record = new SeriesTextRecord(new TestcaseRecordInputStream((short)0x100d, (short)data.length, data));
-
assertEquals( (short)0, record.getId());
-
assertEquals( (byte)0x0C, record.getTextLength());
-
assertEquals( (byte)0x01, record.getUndocumented());
-
assertEquals( "Value Number", record.getText());
-
assertEquals( 32, record.getRecordSize() );
-
- record.validateSid((short)0x100d);
}
public void testStore()
{
SeriesTextRecord record = new SeriesTextRecord();
-
-
record.setId( (short)0 );
-
record.setTextLength( (byte)0x0C );
-
record.setUndocumented( (byte)0x01 );
-
record.setText( "Value Number" );
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver (acoliver at apache.org)
*/
-public class TestSeriesToChartGroupRecord
- extends TestCase
-{
+public final class TestSeriesToChartGroupRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x0, (byte)0x0
};
- public TestSeriesToChartGroupRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SeriesToChartGroupRecord record = new SeriesToChartGroupRecord(new TestcaseRecordInputStream((short)0x1045, (short)data.length, data));
assertEquals( 0x0, record.getChartGroupIndex());
-
assertEquals( 0x6, record.getRecordSize() );
-
- record.validateSid((short)0x1045);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestSheetPropertiesRecord
- extends TestCase
-{
+public final class TestSheetPropertiesRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x0A,(byte)0x00,
(byte)0x00
//,(byte)0x00 // not sure where that last byte comes from
};
- public TestSheetPropertiesRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
SheetPropertiesRecord record = new SheetPropertiesRecord(new TestcaseRecordInputStream((short)0x1044, (short)data.length, data));
assertEquals( 10, record.getFlags());
assertEquals( false, record.isChartTypeManuallyFormatted() );
assertEquals( 7, record.getRecordSize() );
-
- record.validateSid((short)0x1044);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestStringRecord
- extends TestCase
-{
+public class TestStringRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x0B,(byte)0x00, // length
(byte)0x00, // option
(byte)0x46,(byte)0x61,(byte)0x68,(byte)0x72,(byte)0x7A,(byte)0x65,(byte)0x75,(byte)0x67,(byte)0x74,(byte)0x79,(byte)0x70
};
- public TestStringRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
StringRecord record = new StringRecord(new TestcaseRecordInputStream((short)0x207, (short)data.length, data));
assertEquals( "Fahrzeugtyp", record.getString());
assertEquals( 18, record.getRecordSize() );
-
- record.validateSid((short)0x207);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
(byte)'S', (byte)'h', (byte)'e', (byte)'e', (byte)'t', (byte)'2',
};
- public TestSupBookRecord(String name)
- {
- super(name);
- }
-
/**
* tests that we can load the record
*/
assertEquals( 0x4, record.getNumberOfSheets() ); //expected # of sheets
assertEquals( 8, record.getRecordSize() ); //sid+size+data
-
- record.validateSid((short)0x01AE);
}
/**
* tests that we can load the record
assertEquals(2, sheetNames.length);
assertEquals("Sheet1", sheetNames[0].getString());
assertEquals("Sheet2", sheetNames[1].getString());
-
- record.validateSid((short)0x01AE);
}
/**
assertTrue( record.isAddInFunctions() ); //expected flag
assertEquals( 0x1, record.getNumberOfSheets() ); //expected # of sheets
assertEquals( 8, record.getRecordSize() ); //sid+size+data
- record.validateSid((short)0x01AE);
}
/**
TestcaseRecordInputStream.confirmRecordEncoding(0x01AE, dataER, record.serialize());
}
-
- public static void main(String [] args) {
- System.out
- .println("Testing org.apache.poi.hssf.record.SupBookRecord");
- junit.textui.TestRunner.run(TestSupBookRecord.class);
- }
}
assertEquals(0, record.getColInputCol());
assertEquals( 16 + 4, record.getRecordSize() );
- record.validateSid((short)0x236);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestTextObjectBaseRecord
- extends TestCase
-{
+public class TestTextObjectBaseRecord extends TestCase {
byte[] data = new byte[] {
0x44, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00,
};
- public TestTextObjectBaseRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
TextObjectBaseRecord record = new TextObjectBaseRecord(new TestcaseRecordInputStream((short)0x1B6, (short)data.length, data));
assertEquals( 22, record.getRecordSize() );
-
- record.validateSid((short)0x1B6);
}
public void testStore()
-\r
/* ====================================================================\r
Licensed to the Apache Software Foundation (ASF) under one or more\r
contributor license agreements. See the NOTICE file distributed with\r
\r
package org.apache.poi.hssf.record;\r
\r
-import junit.framework.*;\r
-\r
-import java.util.Arrays;\r
-import java.util.List;\r
import java.io.ByteArrayInputStream;\r
+import java.util.Arrays;\r
+\r
+import junit.framework.TestCase;\r
\r
import org.apache.poi.hssf.usermodel.HSSFRichTextString;\r
\r
*\r
* @author Yegor Kozlov\r
*/\r
-public class TestTextObjectRecord extends TestCase {\r
+public final class TestTextObjectRecord extends TestCase {\r
\r
byte[] data = {(byte)0xB6, 0x01, 0x12, 0x00, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,\r
0x00, 0x08, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };\r
\r
\r
- public void testRead()\r
- throws Exception\r
- {\r
-\r
+ public void testRead() {\r
\r
RecordInputStream is = new RecordInputStream(new ByteArrayInputStream(data));\r
is.nextRecord();\r
TextObjectRecord record = new TextObjectRecord(is);\r
\r
assertEquals(TextObjectRecord.sid, record.getSid());\r
- record.validateSid(TextObjectRecord.sid);\r
assertEquals(TextObjectRecord.HORIZONTAL_TEXT_ALIGNMENT_LEFT_ALIGNED, record.getHorizontalTextAlignment());\r
assertEquals(TextObjectRecord.VERTICAL_TEXT_ALIGNMENT_TOP, record.getVerticalTextAlignment());\r
assertEquals(TextObjectRecord.TEXT_ORIENTATION_NONE, record.getTextOrientation());\r
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestTextRecord
- extends TestCase
-{
+public class TestTextRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x02, // horiz align
(byte)0x02, // vert align
(byte)0x00,(byte)0x00 // text rotation
};
- public TestTextRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
TextRecord record = new TextRecord(new TestcaseRecordInputStream((short)0x1025, (short)data.length, data));
assertEquals( TextRecord.HORIZONTAL_ALIGNMENT_CENTER, record.getHorizontalAlignment());
assertEquals( 36, record.getRecordSize() );
-
- record.validateSid((short)0x1025);
-
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Andrew C. Oliver(acoliver at apache.org)
*/
-public class TestTickRecord
- extends TestCase
-{
+public final class TestTickRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x02, (byte)0x00, (byte)0x03, (byte)0x01,
(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
(byte)0x4D, (byte)0x00, (byte)0x00, (byte)0x00
};
- public TestTickRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
TickRecord record = new TickRecord(new TestcaseRecordInputStream((short)0x101e, (short)data.length, data));
assertEquals( (byte)2, record.getMajorTickType());
assertEquals( (byte)0, record.getMinorTickType());
assertEquals( 34, record.getRecordSize() );
-
- record.validateSid((short)0x101e);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestUnitsRecord
- extends TestCase
-{
+public final class TestUnitsRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00, (byte)0x00
};
- public TestUnitsRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
UnitsRecord record = new UnitsRecord(new TestcaseRecordInputStream((short)0x1001, (short)data.length, data));
assertEquals( 0, record.getUnits());
-
assertEquals( 6, record.getRecordSize() );
-
- record.validateSid((short)0x1001);
}
public void testStore()
-
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
-
-
package org.apache.poi.hssf.record;
*
* @author Glen Stampoultzis (glens at apache.org)
*/
-public class TestValueRangeRecord
- extends TestCase
-{
+public final class TestValueRangeRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, // min axis value
(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, // max axis value
(byte)0x1F,(byte)0x01 // options
};
- public TestValueRangeRecord(String name)
- {
- super(name);
- }
-
- public void testLoad()
- throws Exception
- {
+ public void testLoad() {
ValueRangeRecord record = new ValueRangeRecord(new TestcaseRecordInputStream((short)0x101f, (short)data.length, data));
assertEquals( 0.0, record.getMinimumAxisValue(), 0.001);
assertEquals( true, record.isReserved() );
assertEquals( 42+4, record.getRecordSize() );
-
- record.validateSid((short)0x101f);
}
public void testStore()