]> source.dussan.org Git - poi.git/commitdiff
Refactored fillFields() method into constructor in Record class hierarchy
authorJosh Micich <josh@apache.org>
Tue, 30 Sep 2008 06:18:44 +0000 (06:18 +0000)
committerJosh Micich <josh@apache.org>
Tue, 30 Sep 2008 06:18:44 +0000 (06:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@700356 13f79535-47bb-0310-9956-ffa450edef68

156 files changed:
src/java/org/apache/poi/hssf/eventusermodel/dummyrecord/LastCellOfRowDummyRecord.java
src/java/org/apache/poi/hssf/eventusermodel/dummyrecord/MissingCellDummyRecord.java
src/java/org/apache/poi/hssf/eventusermodel/dummyrecord/MissingRowDummyRecord.java
src/java/org/apache/poi/hssf/record/AbstractEscherHolderRecord.java
src/java/org/apache/poi/hssf/record/AreaFormatRecord.java
src/java/org/apache/poi/hssf/record/AreaRecord.java
src/java/org/apache/poi/hssf/record/AxisLineFormatRecord.java
src/java/org/apache/poi/hssf/record/AxisOptionsRecord.java
src/java/org/apache/poi/hssf/record/AxisParentRecord.java
src/java/org/apache/poi/hssf/record/AxisRecord.java
src/java/org/apache/poi/hssf/record/AxisUsedRecord.java
src/java/org/apache/poi/hssf/record/BOFRecord.java
src/java/org/apache/poi/hssf/record/BackupRecord.java
src/java/org/apache/poi/hssf/record/BarRecord.java
src/java/org/apache/poi/hssf/record/BeginRecord.java
src/java/org/apache/poi/hssf/record/BlankRecord.java
src/java/org/apache/poi/hssf/record/BookBoolRecord.java
src/java/org/apache/poi/hssf/record/BoolErrRecord.java
src/java/org/apache/poi/hssf/record/BottomMarginRecord.java
src/java/org/apache/poi/hssf/record/BoundSheetRecord.java
src/java/org/apache/poi/hssf/record/CFHeaderRecord.java
src/java/org/apache/poi/hssf/record/CFRuleRecord.java
src/java/org/apache/poi/hssf/record/CRNCountRecord.java
src/java/org/apache/poi/hssf/record/CRNRecord.java
src/java/org/apache/poi/hssf/record/CalcCountRecord.java
src/java/org/apache/poi/hssf/record/CalcModeRecord.java
src/java/org/apache/poi/hssf/record/CategorySeriesAxisRecord.java
src/java/org/apache/poi/hssf/record/ChartFormatRecord.java
src/java/org/apache/poi/hssf/record/ChartRecord.java
src/java/org/apache/poi/hssf/record/ChartTitleFormatRecord.java
src/java/org/apache/poi/hssf/record/CodepageRecord.java
src/java/org/apache/poi/hssf/record/ColumnInfoRecord.java
src/java/org/apache/poi/hssf/record/CommonObjectDataSubRecord.java
src/java/org/apache/poi/hssf/record/ContinueRecord.java
src/java/org/apache/poi/hssf/record/CountryRecord.java
src/java/org/apache/poi/hssf/record/DBCellRecord.java
src/java/org/apache/poi/hssf/record/DSFRecord.java
src/java/org/apache/poi/hssf/record/DVALRecord.java
src/java/org/apache/poi/hssf/record/DVRecord.java
src/java/org/apache/poi/hssf/record/DatRecord.java
src/java/org/apache/poi/hssf/record/DataFormatRecord.java
src/java/org/apache/poi/hssf/record/DateWindow1904Record.java
src/java/org/apache/poi/hssf/record/DefaultColWidthRecord.java
src/java/org/apache/poi/hssf/record/DefaultDataLabelTextPropertiesRecord.java
src/java/org/apache/poi/hssf/record/DefaultRowHeightRecord.java
src/java/org/apache/poi/hssf/record/DeltaRecord.java
src/java/org/apache/poi/hssf/record/DimensionsRecord.java
src/java/org/apache/poi/hssf/record/DrawingRecord.java
src/java/org/apache/poi/hssf/record/EOFRecord.java
src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java
src/java/org/apache/poi/hssf/record/EndRecord.java
src/java/org/apache/poi/hssf/record/EndSubRecord.java
src/java/org/apache/poi/hssf/record/EscherAggregate.java
src/java/org/apache/poi/hssf/record/ExtSSTInfoSubRecord.java
src/java/org/apache/poi/hssf/record/ExtSSTRecord.java
src/java/org/apache/poi/hssf/record/ExtendedFormatRecord.java
src/java/org/apache/poi/hssf/record/ExternSheetRecord.java
src/java/org/apache/poi/hssf/record/ExternalNameRecord.java
src/java/org/apache/poi/hssf/record/FilePassRecord.java
src/java/org/apache/poi/hssf/record/FileSharingRecord.java
src/java/org/apache/poi/hssf/record/FnGroupCountRecord.java
src/java/org/apache/poi/hssf/record/FontBasisRecord.java
src/java/org/apache/poi/hssf/record/FontIndexRecord.java
src/java/org/apache/poi/hssf/record/FontRecord.java
src/java/org/apache/poi/hssf/record/FooterRecord.java
src/java/org/apache/poi/hssf/record/FormatRecord.java
src/java/org/apache/poi/hssf/record/FormulaRecord.java
src/java/org/apache/poi/hssf/record/FrameRecord.java
src/java/org/apache/poi/hssf/record/GridsetRecord.java
src/java/org/apache/poi/hssf/record/GroupMarkerSubRecord.java
src/java/org/apache/poi/hssf/record/GutsRecord.java
src/java/org/apache/poi/hssf/record/HCenterRecord.java
src/java/org/apache/poi/hssf/record/HeaderRecord.java
src/java/org/apache/poi/hssf/record/HideObjRecord.java
src/java/org/apache/poi/hssf/record/HyperlinkRecord.java
src/java/org/apache/poi/hssf/record/IndexRecord.java
src/java/org/apache/poi/hssf/record/InterfaceEndRecord.java
src/java/org/apache/poi/hssf/record/InterfaceHdrRecord.java
src/java/org/apache/poi/hssf/record/IterationRecord.java
src/java/org/apache/poi/hssf/record/LabelRecord.java
src/java/org/apache/poi/hssf/record/LabelSSTRecord.java
src/java/org/apache/poi/hssf/record/LeftMarginRecord.java
src/java/org/apache/poi/hssf/record/LegendRecord.java
src/java/org/apache/poi/hssf/record/LineFormatRecord.java
src/java/org/apache/poi/hssf/record/LinkedDataFormulaField.java
src/java/org/apache/poi/hssf/record/LinkedDataRecord.java
src/java/org/apache/poi/hssf/record/MMSRecord.java
src/java/org/apache/poi/hssf/record/MergeCellsRecord.java
src/java/org/apache/poi/hssf/record/MulBlankRecord.java
src/java/org/apache/poi/hssf/record/MulRKRecord.java
src/java/org/apache/poi/hssf/record/NameRecord.java
src/java/org/apache/poi/hssf/record/NoteRecord.java
src/java/org/apache/poi/hssf/record/NoteStructureSubRecord.java
src/java/org/apache/poi/hssf/record/NumberFormatIndexRecord.java
src/java/org/apache/poi/hssf/record/NumberRecord.java
src/java/org/apache/poi/hssf/record/ObjRecord.java
src/java/org/apache/poi/hssf/record/ObjectLinkRecord.java
src/java/org/apache/poi/hssf/record/ObjectProtectRecord.java
src/java/org/apache/poi/hssf/record/PageBreakRecord.java
src/java/org/apache/poi/hssf/record/PaletteRecord.java
src/java/org/apache/poi/hssf/record/PaneRecord.java
src/java/org/apache/poi/hssf/record/PasswordRecord.java
src/java/org/apache/poi/hssf/record/PasswordRev4Record.java
src/java/org/apache/poi/hssf/record/PlotAreaRecord.java
src/java/org/apache/poi/hssf/record/PlotGrowthRecord.java
src/java/org/apache/poi/hssf/record/PrecisionRecord.java
src/java/org/apache/poi/hssf/record/PrintGridlinesRecord.java
src/java/org/apache/poi/hssf/record/PrintHeadersRecord.java
src/java/org/apache/poi/hssf/record/PrintSetupRecord.java
src/java/org/apache/poi/hssf/record/ProtectRecord.java
src/java/org/apache/poi/hssf/record/ProtectionRev4Record.java
src/java/org/apache/poi/hssf/record/RKRecord.java
src/java/org/apache/poi/hssf/record/RecalcIdRecord.java
src/java/org/apache/poi/hssf/record/Record.java
src/java/org/apache/poi/hssf/record/RefModeRecord.java
src/java/org/apache/poi/hssf/record/RefreshAllRecord.java
src/java/org/apache/poi/hssf/record/RightMarginRecord.java
src/java/org/apache/poi/hssf/record/RowRecord.java
src/java/org/apache/poi/hssf/record/SCLRecord.java
src/java/org/apache/poi/hssf/record/SSTRecord.java
src/java/org/apache/poi/hssf/record/SaveRecalcRecord.java
src/java/org/apache/poi/hssf/record/ScenarioProtectRecord.java
src/java/org/apache/poi/hssf/record/SelectionRecord.java
src/java/org/apache/poi/hssf/record/SeriesChartGroupIndexRecord.java
src/java/org/apache/poi/hssf/record/SeriesIndexRecord.java
src/java/org/apache/poi/hssf/record/SeriesLabelsRecord.java
src/java/org/apache/poi/hssf/record/SeriesListRecord.java
src/java/org/apache/poi/hssf/record/SeriesRecord.java
src/java/org/apache/poi/hssf/record/SeriesTextRecord.java
src/java/org/apache/poi/hssf/record/SeriesToChartGroupRecord.java
src/java/org/apache/poi/hssf/record/SharedValueRecordBase.java
src/java/org/apache/poi/hssf/record/SheetPropertiesRecord.java
src/java/org/apache/poi/hssf/record/StringRecord.java
src/java/org/apache/poi/hssf/record/StyleRecord.java
src/java/org/apache/poi/hssf/record/SubRecord.java
src/java/org/apache/poi/hssf/record/SupBookRecord.java
src/java/org/apache/poi/hssf/record/TabIdRecord.java
src/java/org/apache/poi/hssf/record/TextObjectBaseRecord.java
src/java/org/apache/poi/hssf/record/TextObjectRecord.java
src/java/org/apache/poi/hssf/record/TextRecord.java
src/java/org/apache/poi/hssf/record/TickRecord.java
src/java/org/apache/poi/hssf/record/TopMarginRecord.java
src/java/org/apache/poi/hssf/record/UncalcedRecord.java
src/java/org/apache/poi/hssf/record/UnicodeString.java
src/java/org/apache/poi/hssf/record/UnitsRecord.java
src/java/org/apache/poi/hssf/record/UnknownRecord.java
src/java/org/apache/poi/hssf/record/UseSelFSRecord.java
src/java/org/apache/poi/hssf/record/VCenterRecord.java
src/java/org/apache/poi/hssf/record/ValueRangeRecord.java
src/java/org/apache/poi/hssf/record/WSBoolRecord.java
src/java/org/apache/poi/hssf/record/WindowOneRecord.java
src/java/org/apache/poi/hssf/record/WindowProtectRecord.java
src/java/org/apache/poi/hssf/record/WindowTwoRecord.java
src/java/org/apache/poi/hssf/record/WriteAccessRecord.java
src/java/org/apache/poi/hssf/record/WriteProtectRecord.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFWorkbook.java

index b259788a85a0984212b86c2c1516cef7758617ec..670fa99d2a9784d0930636547f1c7eed83ba56c6 100644 (file)
@@ -18,7 +18,6 @@
 package org.apache.poi.hssf.eventusermodel.dummyrecord;
 
 import org.apache.poi.hssf.record.Record;
-import org.apache.poi.hssf.record.RecordInputStream;
 
 /**
  * A dummy record to indicate that we've now had the last
@@ -47,15 +46,10 @@ public class LastCellOfRowDummyRecord extends Record {
         */
        public int getLastColumnNumber() { return lastColumnNumber; }
        
-       protected void fillFields(RecordInputStream in) {
-       }
        public short getSid() {
                return -1;
        }
        public int serialize(int offset, byte[] data) {
                return -1;
        }
-       protected void validateSid(short id) {
-       }
-
 }
index 61dc7ac5bd1a7d3c80f910855d83694d41432c25..587ccb6596cfc81517ae2559bc9e97adcadf56c6 100644 (file)
@@ -18,7 +18,6 @@
 package org.apache.poi.hssf.eventusermodel.dummyrecord;
 
 import org.apache.poi.hssf.record.Record;
-import org.apache.poi.hssf.record.RecordInputStream;
 
 /**
  * A dummy record for when we're missing a cell in a row,
@@ -33,16 +32,12 @@ public class MissingCellDummyRecord extends Record {
                this.column = column;
        }
        
-       protected void fillFields(RecordInputStream in) {
-       }
        public short getSid() {
                return -1;
        }
        public int serialize(int offset, byte[] data) {
                return -1;
        }
-       protected void validateSid(short id) {
-       }
        
        public int getRow() { return row; }
        public int getColumn() { return column; }
index 68a86528ac2fbeefb642b7d364b1c93b92a6fd7f..46f76b1d348db665842b96ae78ecdaf5b4cc326a 100644 (file)
@@ -31,16 +31,12 @@ public class MissingRowDummyRecord extends Record {
                this.rowNumber = rowNumber;
        }
        
-       protected void fillFields(RecordInputStream in) {
-       }
        public short getSid() {
                return -1;
        }
        public int serialize(int offset, byte[] data) {
                return -1;
        }
-       protected void validateSid(short id) {
-       }
        
        public int getRowNumber() {
                return rowNumber;
index 89eb9301b7051ff0b612e4229621df961ed40681..295a86a703d603f6571280e30d699cdbe019525b 100644 (file)
@@ -57,18 +57,7 @@ public abstract class AbstractEscherHolderRecord
         escherRecords = new ArrayList();
     }
 
-    /**
-     * Constructs a Bar record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
     public AbstractEscherHolderRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         escherRecords = new ArrayList();
         if (! DESERIALISE )
index de810245a5662b4ac69d84bb2605330149c1a69c..65658ab3ed5d8ef1098aa1868d018a4ef5484bbd 100644 (file)
@@ -48,19 +48,7 @@ public final class AreaFormatRecord extends Record {
 
     }
 
-    /**
-     * Constructs a AreaFormat record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public AreaFormatRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_foregroundColor        = in.readInt();
         field_2_backgroundColor        = in.readInt();
index 17d54ce8bb5e49b64b64838f86d8d3322c2ab775..de994427f586834452af88057cfdb97b2332c5dc 100644 (file)
@@ -42,19 +42,7 @@ public final class AreaRecord extends Record {
 
     }
 
-    /**
-     * Constructs a Area record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public AreaRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
 
         field_1_formatFlags            = in.readShort();
index 9aa8407fc54f70d860a76edb13718e7641db0424..64d2a071d96973b9b58802f655f8aa3c47b55c4f 100644 (file)
@@ -46,19 +46,7 @@ public class AxisLineFormatRecord
 
     }
 
-    /**
-     * Constructs a AxisLineFormat record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public AxisLineFormatRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_axisType               = in.readShort();
     }
index 20ab70bcb8774adf197e645d698dd02d7d262a69..54cd2b49bcc689c67b1e292987558d31d929d6d8 100644 (file)
@@ -57,19 +57,7 @@ public final class AxisOptionsRecord extends Record {
 
     }
 
-    /**
-     * Constructs a AxisOptions record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public AxisOptionsRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_minimumCategory        = in.readShort();
         field_2_maximumCategory        = in.readShort();
index 150acb2b2e19be519588fa7664fe1422af0c893f..281a0824f53d9f5c7eedf3a61240e2a7ef8ef350 100644 (file)
@@ -48,19 +48,7 @@ public class AxisParentRecord
 
     }
 
-    /**
-     * Constructs a AxisParent record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public AxisParentRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_axisType               = in.readShort();
         field_2_x                      = in.readInt();
index 3f956512479409315bf8e438a8acec1d2d3c2985..b57ac1d4f93aff5fd638d1681bdfdf1bc7f08df1 100644 (file)
@@ -49,19 +49,7 @@ public class AxisRecord
 
     }
 
-    /**
-     * Constructs a Axis record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public AxisRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_axisType               = in.readShort();
         field_2_reserved1              = in.readInt();
index bde01c32a8cc0aeb0ff696bc078419cb87972768..361ae2304f76881190709696f59f8a919cd91ec3 100644 (file)
@@ -42,19 +42,7 @@ public class AxisUsedRecord
 
     }
 
-    /**
-     * Constructs a AxisUsed record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public AxisUsedRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_numAxis                = in.readShort();
     }
index a7c3ee0ef3a01c3a956e655d41e5989a77c6775e..672505f5b0f9f1e0f616c7ff8d20d1ee2115b58a 100644 (file)
@@ -86,19 +86,7 @@ public class BOFRecord
     {
     }
 
-    /**
-     * Constructs a BOFRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
-
     public BOFRecord(RecordInputStream in)
-    {
-        super(in);
-
-        // fillFields(data,size);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_version  = in.readShort();
         field_2_type     = in.readShort();
index 47370f4fb235f888f8e93b5b942b36d2fff6d714..2ffbb5ba796e5700b3f61056ee6462fa131338bb 100644 (file)
@@ -40,17 +40,7 @@ public class BackupRecord
     {
     }
 
-    /**
-     * Constructs a BackupRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
-
     public BackupRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_backup = in.readShort();
     }
index 2239e56e0189df0ad16c9867128a63876fe2441d..dbf41202ac404849e0fba0053e871a0a35b68921 100644 (file)
@@ -47,19 +47,7 @@ public final class BarRecord extends Record {
 
     }
 
-    /**
-     * Constructs a Bar record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public BarRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_barSpace               = in.readShort();
         field_2_categorySpace          = in.readShort();
index f7347619c8ce81c1bdc1570190947026f37bba61..c983590bd64228fb275b5dd2b2c1da655fb97fbd 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -29,10 +27,7 @@ import org.apache.poi.util.LittleEndian;
  *
  * @author Glen Stampoultzis (glens at apache.org)
  */
-
-public class BeginRecord
-    extends Record
-{
+public class BeginRecord extends Record {
     public static final short sid = 0x1033;
 
     public BeginRecord()
@@ -40,16 +35,9 @@ public class BeginRecord
     }
 
     /**
-     * Constructs a BeginRecord record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
+     * @param in unused (since this record has no data)
      */
-
     public BeginRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
     }
 
@@ -64,9 +52,8 @@ public class BeginRecord
 
     public int serialize(int offset, byte [] data)
     {
-        LittleEndian.putShort(data, 0 + offset, sid);
-        LittleEndian.putShort(data, 2 + offset,
-                              (( short ) 0));   // no record info
+        LittleEndian.putUShort(data, 0 + offset, sid);
+        LittleEndian.putUShort(data, 2 + offset, 0);   // no record info
         return getRecordSize();
     }
 
index 4d333eb418bad8d681b2f661f10c2d95ad4c4da1..864cc53c3c9e666dbee76a5fe77a66a09a28d923 100644 (file)
@@ -39,16 +39,7 @@ public final class BlankRecord extends Record implements CellValueRecordInterfac
     {
     }
 
-    /**
-     * Constructs a BlankRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
     public BlankRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_row = in.readUShort();
         field_2_col = in.readShort();
index 150dc5dfda57c3a33d7e0f5cd7e28f9a7db86156..0ad7a5ac6096e72a2cae766a9358b9f95c86b7d9 100644 (file)
@@ -40,17 +40,7 @@ public class BookBoolRecord
     {
     }
 
-    /**
-     * Constructs a BookBoolRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
-
     public BookBoolRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_save_link_values = in.readShort();
     }
index 77ece1632c593142f842faab15159e0b2414f927..bed162f94cc528974e0eced9a1d712315c91081a 100644 (file)
@@ -41,19 +41,9 @@ public final class BoolErrRecord extends Record implements CellValueRecordInterf
     }
 
     /**
-     * Constructs a BoolErr record and sets its fields appropriately.
-     *
      * @param in the RecordInputstream to read the record from
      */
     public BoolErrRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    /**
-     * @param in the RecordInputstream to read the record from
-     */
-    protected void fillFields(RecordInputStream in)
     {
         //field_1_row      = LittleEndian.getShort(data, 0 + offset);
         field_1_row      = in.readUShort();
index 8c8a4a9434750a2ee2fcc209ee745b72637be0ce..c8f50ff1c14aa24ae4be2095446a4576e50a4a7f 100644 (file)
@@ -39,17 +39,7 @@ public class BottomMarginRecord
 
     }
 
-    /**
-     * Constructs a BottomMargin record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
     public BottomMarginRecord( RecordInputStream in )
-    {
-        super( in );
-    }
-
-    protected void fillFields( RecordInputStream in )
     {
         field_1_margin = in.readDouble();
     }
@@ -108,4 +98,4 @@ public class BottomMarginRecord
         return rec;
     }
 
-}  // END OF CLASS
\ No newline at end of file
+}  // END OF CLAS
\ No newline at end of file
index 5cc087e65694cedcdd958f7dc01c6db906669207..036de6b2dfe91d4586873b80cfb32d11c296eb3a 100644 (file)
@@ -52,15 +52,6 @@ public final class BoundSheetRecord extends Record {
                setSheetname(sheetname);
        }
 
-       /**
-        * Constructs a BoundSheetRecord and sets its fields appropriately
-        *
-        * @param in the RecordInputstream to read the record from
-        */
-       public BoundSheetRecord(RecordInputStream in) {
-               super(in);
-       }
-
        /**
         * UTF8: sid + len + bof + flags + len(str) + unicode + str 2 + 2 + 4 + 2 +
         * 1 + 1 + len(str)
@@ -69,7 +60,7 @@ public final class BoundSheetRecord extends Record {
         * 1 + 1 + 2 * len(str)
         * 
         */
-       protected void fillFields(RecordInputStream in) {
+       public BoundSheetRecord(RecordInputStream in) {
                field_1_position_of_BOF = in.readInt();
                field_2_option_flags = in.readUShort();
                int field_3_sheetname_length = in.readUByte();
index af8e4315eeec7527e152f4d3815d54d095e2f750..47fba0b955b11851b90acc7fd2e7a5026aa544ac 100644 (file)
@@ -48,11 +48,6 @@ public final class CFHeaderRecord extends Record {
        }
 
        public CFHeaderRecord(RecordInputStream in)
-       {
-               super(in);
-       }
-
-       protected void fillFields(RecordInputStream in)
        {
                field_1_numcf = in.readShort();
                field_2_need_recalculation = in.readShort();
index c440b416fb5994769d317af60166f8284e2fd30d..ef8e05c29d54998b6deac6f22f63e7d6ab89edb1 100644 (file)
@@ -159,10 +159,6 @@ public final class CFRuleRecord extends Record {
        }
 
        public CFRuleRecord(RecordInputStream in) {
-               super(in);
-       }
-
-       protected void fillFields(RecordInputStream in) {
                field_1_condition_type = in.readByte();
                field_2_comparison_operator = in.readByte();
                int field_3_formula1_len = in.readUShort();
index 288031d5b81218018b6da6fdf3da0833a335c7aa..5df98bf34edcc7dcc85ab06d0822c530a834af95 100755 (executable)
@@ -38,16 +38,12 @@ public final class CRNCountRecord extends Record {
                throw new RuntimeException("incomplete code");
        }
 
-       public CRNCountRecord(RecordInputStream in) {
-               super(in);
-       }
-
        public int getNumberOfCRNs() {
                return field_1_number_crn_records;
        }
 
 
-       protected void fillFields(RecordInputStream in) {
+       public CRNCountRecord(RecordInputStream in) {
                field_1_number_crn_records = in.readShort();
                if(field_1_number_crn_records < 0) {
                        // TODO - seems like the sign bit of this field might be used for some other purpose
index 98c399a21b138bc5f052abf93dbc6b09de9acfa8..417f2a559a3250c749facea04750cb82f51bffec 100755 (executable)
@@ -39,16 +39,12 @@ public final class CRNRecord extends Record {
                throw new RuntimeException("incomplete code");
        }
 
-       public CRNRecord(RecordInputStream in) {
-               super(in);
-       }
-
        public int getNumberOfCRNs() {
                return field_1_last_column_index;
        }
 
 
-       protected void fillFields(RecordInputStream in) {
+       public CRNRecord(RecordInputStream in) {
                field_1_last_column_index = in.readByte() & 0x00FF;
                field_2_first_column_index = in.readByte() & 0x00FF;
                field_3_row_index = in.readShort();
index 0d4d5e0d7da4542ff9973c78f5c9d923420ce9de..eb783f3857bf2313cebf6c5a56eb844b09370032 100644 (file)
@@ -45,18 +45,7 @@ public class CalcCountRecord
     {
     }
 
-    /**
-     * Constructs a CalcCountRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     *
-     */
-
     public CalcCountRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_iterations = in.readShort();
     }
index b2c323de4552cc8bbcd77f70a0f9d5dada7ecf72..de8d860fcec1d0700433b7be16d51743c5fc3588 100644 (file)
@@ -61,17 +61,7 @@ public class CalcModeRecord
     {
     }
 
-    /**
-     * Constructs a CalcModeRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
-
     public CalcModeRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_calcmode = in.readShort();
     }
index ff5906360438e63e67726f9d25b363ee897ec83e..158b3e5cf6c53540bdd3efb494f42b037bdfa70f 100644 (file)
@@ -47,19 +47,7 @@ public final class CategorySeriesAxisRecord extends Record {
 
     }
 
-    /**
-     * Constructs a CategorySeriesAxis record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public CategorySeriesAxisRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_crossingPoint          = in.readShort();
         field_2_labelFrequency         = in.readShort();
index f7c6384df93c5ded3e629be3dbe9eb8fc9eaec88..490cdd45551d5a5c140ce3116405c277236800c8 100644 (file)
@@ -44,17 +44,7 @@ public final class ChartFormatRecord extends Record {
     {
     }
 
-    /**
-     * Constructs a ChartFormatRecord record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ChartFormatRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field1_x_position = in.readInt();
         field2_y_position = in.readInt();
index 6e2e98191b76ac134f122f1d018d47c1ab6f7a5d..9ce93946aed9840e7c7cb91ef12ee7d42545722d 100644 (file)
@@ -45,19 +45,7 @@ public class ChartRecord
 
     }
 
-    /**
-     * Constructs a Chart record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ChartRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_x                      = in.readInt();
         field_2_y                      = in.readInt();
index 0d522e7775a7f7e62aaaead605d502ce3c7389a6..fd22d5229b4a4734f6ab51aa43e15364a14790aa 100644 (file)
@@ -59,10 +59,6 @@ public class ChartTitleFormatRecord extends Record {
        }
 
        public ChartTitleFormatRecord(RecordInputStream in) {
-               super(in);
-       }
-
-       protected void fillFields(RecordInputStream in) {
                m_recs = in.readUShort();
                int idx;
                CTFormat ctf;
index 285f5d0b579abd13bfc02a5840e16ed6810a2fbd..4675fe473041d67bc3f95a510f502976cbe74cec 100644 (file)
@@ -47,17 +47,7 @@ public class CodepageRecord
     {
     }
 
-    /**
-     * Constructs a CodepageRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
-
     public CodepageRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_codepage = in.readShort();
     }
index b8934efb08097e99fc93c71b08dcbd17fa663f3b..38d05181c9f18ff37878995acad835157a47928d 100644 (file)
@@ -52,17 +52,7 @@ public final class ColumnInfoRecord extends Record {
         field_6_reserved = 2; // seems to be the most common value
     }
 
-    /**
-     * Constructs a ColumnInfo record and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ColumnInfoRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_first_col = in.readUShort();
         field_2_last_col  = in.readUShort();
index 43c6ad854957928bc54e80b5704e8d03cc3b15ea..ed2372d82ffa867610e4460b027f43819edac8a8 100644 (file)
@@ -82,18 +82,7 @@ public final class CommonObjectDataSubRecord extends SubRecord {
 
     }
 
-    /**
-     * Constructs a CommonObjectData record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public CommonObjectDataSubRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_objectType             = in.readShort();
         field_2_objectId               = in.readShort();
index 5402a46bd34a1fab8ceda290813802bfb783fc83..435c45471231430f2f90d71fb395a6b119472c4f 100644 (file)
@@ -45,17 +45,6 @@ public class ContinueRecord
     {
     }
 
-    /**
-     * Main constructor -- kinda dummy because we don't validate or fill fields
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
-    public ContinueRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
     /**
      * USE ONLY within "processContinue"
      */
@@ -125,7 +114,7 @@ public class ContinueRecord
      * @param in the RecordInputstream to read the record from
      */
 
-    protected void fillFields(RecordInputStream in)
+    public ContinueRecord(RecordInputStream in)
     {
       field_1_data = in.readRemainder();
     }
index 0acccfd918239ade800b9f2fe2d54914438d4e1e..7d739a9b652c701d3650308517ba700d34ca8a06 100644 (file)
@@ -44,17 +44,7 @@ public class CountryRecord
     {
     }
 
-    /**
-     * Constructs a CountryRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
-
     public CountryRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_default_country = in.readShort();
         field_2_current_country = in.readShort();
index efa713aec62ce32c76007f151b99a4653888ce6c..4085027dd4b981ca4c6fc46e13e7af5b03647e8d 100644 (file)
@@ -38,16 +38,7 @@ public final class DBCellRecord extends Record {
         field_2_cell_offsets = new short[0];
     }
 
-    /**
-     * Constructs a DBCellRecord and sets its fields appropriately
-     * @param in the RecordInputstream to read the record from
-     */
     public DBCellRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_row_offset   = in.readUShort();
         int size = in.remaining();        
index 43dbe79580645f511e9783023c7bf31d82202a79..9d405b3dda59c9e4ecbc1d53573157627c6cedc3 100644 (file)
@@ -40,17 +40,7 @@ public class DSFRecord
     {
     }
 
-    /**
-     * Constructs a DBCellRecord and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DSFRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_dsf = in.readShort();
     }
index c4fac186d264d7f62b80b334af4e2f0d58e90d97..9235ef2c6cfb02dd4e4c30e453c0d3cdeca215e8 100644 (file)
@@ -48,18 +48,7 @@ public class DVALRecord extends Record
         field_5_dv_no = 0x00000000;
     }
 
-    /**
-     * Constructs a DVAL record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
-    public DVALRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-       protected void fillFields(RecordInputStream in)
+       public DVALRecord(RecordInputStream in)
        {
                this.field_1_options = in.readShort();
                this.field_2_horiz_pos = in.readInt();
index 2a3dc05f14dd843e591f93ad937604a7d2d3b8f6..0c0cd1b73f581e3b8e450dfe866b9ee80c21810f 100644 (file)
@@ -75,15 +75,6 @@ public final class DVRecord extends Record {
        private static final BitField opt_show_error_on_invalid_value  = new BitField(0x00080000);
        private static final BitField opt_condition_operator           = new BitField(0x00700000);
 
-       /**
-        * Constructs a DV record and sets its fields appropriately.
-        *
-        * @param in the RecordInputstream to read the record from
-        */
-       public DVRecord(RecordInputStream in) {
-               super(in);
-       }
-
        public DVRecord(int validationType, int operator, int errorStyle, boolean emptyCellAllowed,
                        boolean suppressDropDownArrow, boolean isExplicitList,
                        boolean showPromptBox, String promptTitle, String promptText, 
@@ -110,7 +101,7 @@ public final class DVRecord extends Record {
                _regions = regions;
        }
 
-       protected void fillFields(RecordInputStream in) {
+       public DVRecord(RecordInputStream in) {
                
           _option_flags = in.readInt();
           
index c7ece181aed69a62d17e42db8fa765580b02cfff..a6c5040150835762deae37ff94eb74b2e2267875 100644 (file)
@@ -45,19 +45,7 @@ public final class DatRecord extends Record {
 
     }
 
-    /**
-     * Constructs a Dat record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DatRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_options                = in.readShort();
     }
index 61c59bcfd32a2e82080693fbcc64de2c354f05a1..7d37704eb770defa62237b3f76e3cfa36d22e914 100644 (file)
@@ -45,19 +45,7 @@ public final class DataFormatRecord extends Record {
 
     }
 
-    /**
-     * Constructs a DataFormat record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DataFormatRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_pointNumber            = in.readShort();
         field_2_seriesIndex            = in.readShort();
index 5e7ffe95bfd284e94ef13e5e7dea79dc237c7056..dd023fa803d2e95ee4f3919386f424f0520bd3d2 100644 (file)
@@ -40,17 +40,7 @@ public class DateWindow1904Record
     {
     }
 
-    /**
-     * Constructs a DateWindow1904 record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DateWindow1904Record(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_window = in.readShort();
     }
index 9d3e5d80e6252c538854aa7eb757d3bfb652849e..8ceb88edfa558ee586d7b2c94fc0674644732300 100644 (file)
@@ -36,17 +36,7 @@ public final class DefaultColWidthRecord extends Record {
     {
     }
 
-    /**
-     * Constructs a DefaultColumnWidth record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DefaultColWidthRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_col_width = in.readUShort();
     }
index 58b3b8f5cf72cc4556faba12997bafe02f722619..49120e75a7d64d8f8b86c4b14091200fb0386951 100644 (file)
@@ -45,19 +45,7 @@ public class DefaultDataLabelTextPropertiesRecord
 
     }
 
-    /**
-     * Constructs a DefaultDataLabelTextProperties record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DefaultDataLabelTextPropertiesRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_categoryDataType       = in.readShort();
     }
index bb93ff83dea8fa899729b1c61abd6cf2a4288cae..ae48ea4b00179bc66e706009d996d86bdca608fd 100644 (file)
@@ -42,17 +42,7 @@ public class DefaultRowHeightRecord
     {
     }
 
-    /**
-     * Constructs a DefaultRowHeight record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DefaultRowHeightRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_option_flags = in.readShort();
         field_2_row_height   = in.readShort();
index 467431eadd73a72cb3f7f6e3127c11c49add3097..d02eb2cef7169f37eb9474c6574f639f6c7fa27d 100644 (file)
@@ -44,17 +44,7 @@ public class DeltaRecord
     {
     }
 
-    /**
-     * Constructs a Delta record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DeltaRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_max_change = in.readDouble();
     }
index adf9f7edf2d89d54a7b9b364bc15c73542a29cf6..fa7477bc79c5dc2b6c6c258093ee298bdf2a6565 100644 (file)
@@ -45,17 +45,7 @@ public class DimensionsRecord
     {
     }
 
-    /**
-     * Constructs a Dimensions record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public DimensionsRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_first_row = in.readInt();
         field_2_last_row  = in.readInt();
index 089c15f903b9ba232c2c90a8e41477b8f4eb271e..c8c54123c994f6ec79ef89cb7c61b852abd182af 100644 (file)
@@ -30,11 +30,6 @@ public class DrawingRecord extends Record
     }
 
     public DrawingRecord( RecordInputStream in )
-    {
-        super( in );
-    }
-
-    protected void fillFields( RecordInputStream in )
     {
       recordData = in.readRemainder();
     }
index 96159b42ab19be3821f78c27e1ad8d03cece64a0..f7495179b44be6a035aab8ee48998f74216a00ec 100644 (file)
@@ -40,16 +40,9 @@ public final class EOFRecord extends Record {
     }
 
     /**
-     * Constructs a EOFRecord record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
+     * @param in unused (since this record has no data)
      */
-
     public EOFRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
     }
 
index b33519c8e1b0fd570f6064f04de9bad8dfc94220..fb6bce5d3a03310b7e0f9aa47a46313bea1640db 100644 (file)
@@ -54,22 +54,12 @@ public class EmbeddedObjectRefSubRecord
         field_5_ole_classname = "";
     }
 
-    /**
-     * Constructs an EmbeddedObjectRef record and sets its fields appropriately.
-     *
-     * @param in the record input stream.
-     */
-    public EmbeddedObjectRefSubRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
     public short getSid()
     {
         return sid;
     }
 
-    protected void fillFields(RecordInputStream in)
+    public EmbeddedObjectRefSubRecord(RecordInputStream in)
     {
         field_1_stream_id_offset       = in.readShort();
         field_2_unknown                = in.readShortArray();
index 48e50ac128c2fcc118e35cc3883ad686a4b70ec5..6f91dc3a2472b3847419841f3434391e28f92400 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -30,9 +28,7 @@ import org.apache.poi.util.LittleEndian;
  * @author Glen Stampoultzis (glens at apache.org)
  */
 
-public class EndRecord
-    extends Record
-{
+public final class EndRecord extends Record {
     public static final short sid = 0x1034;
 
     public EndRecord()
@@ -40,16 +36,9 @@ public class EndRecord
     }
 
     /**
-     * Constructs a EndRecord record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
+     * @param in unused (since this record has no data)
      */
-
     public EndRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
     }
 
@@ -64,9 +53,8 @@ public class EndRecord
 
     public int serialize(int offset, byte [] data)
     {
-        LittleEndian.putShort(data, 0 + offset, sid);
-        LittleEndian.putShort(data, 2 + offset,
-                              (( short ) 0));   // no record info
+        LittleEndian.putUShort(data, 0 + offset, sid);
+        LittleEndian.putUShort(data, 2 + offset, 0);   // no record info
         return getRecordSize();
     }
 
index 59ccb872edac68138c121577dd150604fc342554..e2d3808d84880e6fb6b291d9fa7cbc6fdc4972d9 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    limitations under the License.
 ==================================================================== */
         
-
 package org.apache.poi.hssf.record;
 
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.LittleEndian;
 
 /**
  * The end data record is used to denote the end of the subrecords.
@@ -30,10 +26,8 @@ import org.apache.poi.util.*;
 
  * @author Glen Stampoultzis (glens at apache.org)
  */
-public class EndSubRecord
-    extends SubRecord
-{
-    public final static short      sid                             = 0x00;
+public final class EndSubRecord extends SubRecord {
+    public final static short      sid = 0x00;
 
 
     public EndSubRecord()
@@ -42,18 +36,9 @@ public class EndSubRecord
     }
 
     /**
-     * Constructs a End record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
+     * @param in unused (since this record has no data)
      */
-
     public EndSubRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
     }
 
index d62b59adbb33e9b4b3238f5a94a76310612f2527..bfeb44751b0280b59af85bc9729f66ce53df0474 100644 (file)
 
 package org.apache.poi.hssf.record;
 
-import org.apache.poi.ddf.*;
-import org.apache.poi.hssf.usermodel.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.poi.ddf.DefaultEscherRecordFactory;
+import org.apache.poi.ddf.EscherBoolProperty;
+import org.apache.poi.ddf.EscherClientAnchorRecord;
+import org.apache.poi.ddf.EscherClientDataRecord;
+import org.apache.poi.ddf.EscherContainerRecord;
+import org.apache.poi.ddf.EscherDgRecord;
+import org.apache.poi.ddf.EscherDggRecord;
+import org.apache.poi.ddf.EscherOptRecord;
+import org.apache.poi.ddf.EscherProperties;
+import org.apache.poi.ddf.EscherRecord;
+import org.apache.poi.ddf.EscherRecordFactory;
+import org.apache.poi.ddf.EscherSerializationListener;
+import org.apache.poi.ddf.EscherSpRecord;
+import org.apache.poi.ddf.EscherSpgrRecord;
+import org.apache.poi.ddf.EscherTextboxRecord;
 import org.apache.poi.hssf.model.AbstractShape;
-import org.apache.poi.hssf.model.TextboxShape;
-import org.apache.poi.hssf.model.DrawingManager2;
-import org.apache.poi.hssf.model.ConvertAnchor;
 import org.apache.poi.hssf.model.CommentShape;
+import org.apache.poi.hssf.model.ConvertAnchor;
+import org.apache.poi.hssf.model.DrawingManager2;
+import org.apache.poi.hssf.model.TextboxShape;
+import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
+import org.apache.poi.hssf.usermodel.HSSFPatriarch;
+import org.apache.poi.hssf.usermodel.HSSFShape;
+import org.apache.poi.hssf.usermodel.HSSFShapeContainer;
+import org.apache.poi.hssf.usermodel.HSSFShapeGroup;
+import org.apache.poi.hssf.usermodel.HSSFTextbox;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
 
-import java.util.*;
-
 /**
  * This class is used to aggregate the MSODRAWING and OBJ record
  * combinations.  This is necessary due to the bizare way in which
@@ -282,16 +305,6 @@ public class EscherAggregate extends AbstractEscherHolderRecord
         return sid;
     }
 
-    /**
-     * Unused since this is an aggregate record.  Use createAggregate().
-     *
-     * @see #createAggregate
-     */
-    protected void fillFields( byte[] data, short size, int offset )
-    {
-        throw new IllegalStateException( "Should not reach here" );
-    }
-
     /**
      * Calculates the string representation of this record.  This is
      * simply a dump of all the records.
@@ -539,8 +552,7 @@ public class EscherAggregate extends AbstractEscherHolderRecord
        // The top level container ought to have
        //  the DgRecord and the container of one container
        //  per shape group (patriach overall first)
-       EscherContainerRecord topContainer =
-               (EscherContainerRecord)getEscherContainer();
+       EscherContainerRecord topContainer = getEscherContainer();
        if(topContainer == null) {
                return;
        }
index e6e2317849d75daaff03963453006093be12102f..278bfd78166b4d947209ebd6292d0ed616c777a4 100644 (file)
@@ -51,11 +51,6 @@ public class ExtSSTInfoSubRecord
     }
 
     public ExtSSTInfoSubRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_stream_pos        = in.readInt();
         field_2_bucket_sst_offset = in.readShort();
index 0d99c53241d261420c0a96ccb96e7f826e7a2559..582668f331751ca73a088d81aaef38f16417dd56 100644 (file)
@@ -53,17 +53,7 @@ public class ExtSSTRecord
         field_2_sst_info = new ArrayList();
     }
 
-    /**
-     * Constructs a EOFRecord record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ExtSSTRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_2_sst_info           = new ArrayList();
         field_1_strings_per_bucket = in.readShort();
index a4e81ba55ef43c8d98e134b1c43a8ff0d3422521..0bc50ca89e9a39934283a8d96eb44b097c1b4850 100644 (file)
@@ -195,17 +195,7 @@ public class ExtendedFormatRecord
     {
     }
 
-    /**
-     * Constructs an ExtendedFormat record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ExtendedFormatRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_font_index           = in.readShort();
         field_2_format_index         = in.readShort();
index 71f0d496a18bdf32c5b8d63fe48cfa26ff9d442e..f6266cfa3511f1d2181685de68aa70b7f00336c8 100644 (file)
@@ -95,22 +95,13 @@ public class ExternSheetRecord extends Record {
                _list = new ArrayList();
        }
        
-       /**
-        * Constructs a Extern Sheet record and sets its fields appropriately.
-        * @param in the RecordInputstream to read the record from
-        */
-       
-       public ExternSheetRecord(RecordInputStream in) {
-               super(in);
-       }
-       
        /**
         * called by the constructor, should set class level fields.  Should throw
         * runtime exception for bad/icomplete data.
         *
         * @param in the RecordInputstream to read the record from
         */
-       protected void fillFields(RecordInputStream in) {
+       public ExternSheetRecord(RecordInputStream in) {
                _list              = new ArrayList();
                
                int nItems  = in.readShort();
index 45deae1c6254747824930c472a328e5c343319cb..d2135c085ee1e3a307229a29b8b5c9d50d6630e1 100755 (executable)
@@ -47,11 +47,7 @@ public final class ExternalNameRecord extends Record {
        private short  field_2_index;
        private short  field_3_not_used;
        private String field_4_name;
-       private Ptg[]  field_5_name_definition; // TODO - junits for name definition field
-
-       public ExternalNameRecord(RecordInputStream in) {
-               super(in);
-       }
+       private Ptg[]  field_5_name_definition;
 
        /**
         * Convenience Function to determine if the name is a built-in name
@@ -116,13 +112,13 @@ public final class ExternalNameRecord extends Record {
                LittleEndian.putShort( data, 4 + offset, field_1_option_flag );
                LittleEndian.putShort( data, 6 + offset, field_2_index );
                LittleEndian.putShort( data, 8 + offset, field_3_not_used );
-               short nameLen = (short) field_4_name.length();
-               LittleEndian.putShort( data, 10 + offset, nameLen );
+               int nameLen = field_4_name.length();
+               LittleEndian.putUShort( data, 10 + offset, nameLen );
                StringUtil.putCompressedUnicode( field_4_name, data, 12 + offset );
                if(hasFormula()) {
-                       short defLen = (short) getNameDefinitionSize();
-                       LittleEndian.putShort( data, 12 + nameLen + offset, defLen );
-                       Ptg.serializePtgStack(toStack(field_5_name_definition), data, 14 + nameLen + offset );
+                       int defLen = getNameDefinitionSize();
+                       LittleEndian.putUShort( data, 12 + nameLen + offset, defLen );
+                       Ptg.serializePtgs(field_5_name_definition, data, 14 + nameLen + offset );
                }
                return dataSize + 4;
        }
@@ -141,7 +137,7 @@ public final class ExternalNameRecord extends Record {
        }
 
 
-       protected void fillFields(RecordInputStream in) {
+       public ExternalNameRecord(RecordInputStream in) {
                field_1_option_flag = in.readShort();
                field_2_index       = in.readShort();
                field_3_not_used    = in.readShort();
@@ -158,7 +154,7 @@ public final class ExternalNameRecord extends Record {
                        throw readFail("Ran out of record data trying to read formula.");
                }
                short formulaLen = in.readShort();
-               field_5_name_definition = toPtgArray(Ptg.createParsedExpressionTokens(formulaLen, in));
+               field_5_name_definition = Ptg.readTokens(formulaLen, in);
        }
        /*
         * Makes better error messages (while hasFormula() is not reliable) 
@@ -196,19 +192,6 @@ public final class ExternalNameRecord extends Record {
                return true;
        }
 
-       private static Ptg[] toPtgArray(Stack s) {
-               Ptg[] result = new Ptg[s.size()];
-               s.toArray(result);
-               return result;
-       }
-       private static Stack toStack(Ptg[] ptgs) {
-               Stack result = new Stack();
-               for (int i = 0; i < ptgs.length; i++) {
-                       result.push(ptgs[i]);
-               }
-               return result;
-       }
-
        public short getSid() {
                return sid;
        }
index b14fac83a4fbc76be6cdf30c2577dc2cc5d30217..3af87278e23abac5ec152304a3f0ce58b6436cb5 100644 (file)
@@ -40,17 +40,7 @@ public class FilePassRecord
     {
     }
 
-    /**
-     * Constructs a FILEPASS record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public FilePassRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_encryptedpassword = in.readInt();
         
index e49c07785c263307aaea5771e73cc465f182e83b..3631251995bf5dad76ec2b0efd3a309cbab45dc8 100644 (file)
@@ -36,18 +36,8 @@ public final class FileSharingRecord extends Record {
     private String            field_3_username_value;
 
     public FileSharingRecord() {}
-    
-
-    /**
-     * Constructs a FileSharing record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
 
     public FileSharingRecord(RecordInputStream in) {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in) {
         field_1_readonly = in.readShort();
         field_2_password = in.readShort();
         
index abea11f5d79fbe95724e5ce673094be777282612..23de9135af495057f6b7d0f1a99be1d514029833 100644 (file)
@@ -46,17 +46,7 @@ public class FnGroupCountRecord
     {
     }
 
-    /**
-     * Constructs a FnGroupCount record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public FnGroupCountRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_count = in.readShort();
     }
index 95731d102535d081d235e3dc5da96c4046dfc95f..645db716c0ed263b4cf6a45d6393d16bdee47f94 100644 (file)
@@ -46,19 +46,7 @@ public class FontBasisRecord
 
     }
 
-    /**
-     * Constructs a FontBasis record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public FontBasisRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_xBasis                 = in.readShort();
         field_2_yBasis                 = in.readShort();
index 82d7152e88b34fe86b795662ab0cb0a4b97fabcf..b2ece531757e22a0e66935d679c352ece4d789e4 100644 (file)
@@ -42,19 +42,7 @@ public class FontIndexRecord
 
     }
 
-    /**
-     * Constructs a FontIndex record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public FontIndexRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_fontIndex              = in.readShort();
     }
index deaa92e266855d9aa3c8de25155c2aecf4632dd1..e1d421977402492e4e9b8a73baed70b542d0aba6 100644 (file)
@@ -76,18 +76,7 @@ public class FontRecord
     {
     }
 
-    /**
-     * Constructs a Font record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public FontRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_font_height         = in.readShort();
         field_2_attributes          = in.readShort();
index 9dcd031189ac1521d8e3e1b9106367fe5cd9377f..8434792172d15829448bcb8f2001b69d42cbb771 100644 (file)
@@ -45,17 +45,7 @@ public class FooterRecord
     {
     }
 
-    /**
-     * Constructs a FooterRecord record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public FooterRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         if (in.remaining() > 0)
         {
index 47a45c4f0e6622021862261299b5976cb259342a..b8f4ea22ad44c52c4e6e158c405fbb65ec798d17 100644 (file)
@@ -46,17 +46,7 @@ public class FormatRecord
     {
     }
 
-    /**
-     * Constructs a Format record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public FormatRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_index_code       = in.readShort();
         field_3_unicode_len      = in.readShort();
index 21ca8cccb538d80485e1b51c3c3afb056c44f1b5..a6c97d46efd85ec4b98e93df859409de210d535e 100644 (file)
@@ -186,20 +186,7 @@ public final class FormulaRecord extends Record implements CellValueRecordInterf
                field_8_parsed_expr = Ptg.EMPTY_PTG_ARRAY;
        }
 
-       /**
-        * Constructs a Formula record and sets its fields appropriately.
-        * Note - id must be 0x06 (NOT 0x406 see MSKB #Q184647 for an
-        * "explanation of this bug in the documentation) or an exception
-        *  will be throw upon validation
-        *
-        * @param in the RecordInputstream to read the record from
-        */
-
        public FormulaRecord(RecordInputStream in) {
-               super(in);
-       }
-
-       protected void fillFields(RecordInputStream in) {
                field_1_row      = in.readUShort();
                field_2_column  = in.readShort();
                field_3_xf        = in.readShort();
index 321c867d929c5f8028d389c5b20e8e36c5c95307..4425b0817d6fd218afb786ba1acefc519ed85d69 100644 (file)
@@ -46,19 +46,7 @@ public final class FrameRecord extends Record {
 
     }
 
-    /**
-     * Constructs a Frame record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public FrameRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_borderType             = in.readShort();
         field_2_options                = in.readShort();
index 681b7cdc1498fd4fe51af3eaadf413ae524cea45..ad652ba8245c066924813418fa6d37a5547f4bbd 100644 (file)
@@ -44,17 +44,7 @@ public class GridsetRecord
     {
     }
 
-    /**
-     * Constructs a GridSet record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public GridsetRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_gridset_flag = in.readShort();
     }
index d72b4be65bdf51f20ce003a7f20535a2e9f636f5..0618ea6f4fc12e4abdca961fe261d5edfbb354b2 100644 (file)
@@ -41,19 +41,7 @@ public class GroupMarkerSubRecord
 
     }
 
-    /**
-     * Constructs a group marker record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public GroupMarkerSubRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
 //        int pos = 0;
         reserved = in.readRemainder();
index d165439215712911437dd1c03dc2893a8f023690..0073066ec1e98ea674c9c96170868485c6db642e 100644 (file)
@@ -43,17 +43,7 @@ public class GutsRecord
     {
     }
 
-    /**
-     * Constructs a Guts record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public GutsRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_left_row_gutter = in.readShort();
         field_2_top_col_gutter  = in.readShort();
index cfcdb00afe50645424143e0d16756d86939971de..261431e7167df837b966089c0982c70853ab8025 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    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;
 
 import org.apache.poi.util.LittleEndian;
 
 /**
- * Title:        HCenter record<P>
+ * Title:        HCenter record (0x0083)<P>
  * Description:  whether to center between horizontal margins<P>
  * REFERENCE:  PG 320 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @author Jason Height (jheight at chariot dot net dot au)
  * @version 2.0-pre
  */
-
-public class HCenterRecord
-    extends Record
-{
-    public final static short sid = 0x83;
+public final class HCenterRecord extends Record {
+    public final static short sid = 0x0083;
     private short             field_1_hcenter;
 
     public HCenterRecord()
     {
     }
 
-    /**
-     * Constructs an HCenter record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public HCenterRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_hcenter = in.readShort();
     }
@@ -96,8 +81,8 @@ public class HCenterRecord
     public int serialize(int offset, byte [] data)
     {
         LittleEndian.putShort(data, 0 + offset, sid);
-        LittleEndian.putShort(data, 2 + offset, ( short ) 0x2);
-        LittleEndian.putShort(data, 4 + offset, ( short ) field_1_hcenter);
+        LittleEndian.putUShort(data, 2 + offset, 0x2);
+        LittleEndian.putUShort(data, 4 + offset, field_1_hcenter);
         return getRecordSize();
     }
 
index 57846ee73ceb467f6ed346cb5f20afb92f46450c..61ff851306a14279aca8ffe570c5fcd6b976eae6 100644 (file)
@@ -45,17 +45,7 @@ public class HeaderRecord
     {
     }
 
-    /**
-     * Constructs an Header record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public HeaderRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         if (in.remaining() > 0)
         {
index 2786de4571affce29117e1d88635918f8ae22430..496002618ace17a9f2e770a83833375c1013ab6c 100644 (file)
@@ -42,17 +42,7 @@ public class HideObjRecord
     {
     }
 
-    /**
-     * Constructs an HideObj record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public HideObjRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_hide_obj = in.readShort();
     }
index 6daf192ca22867916faccb5970f9685848504073..6fc5b97163d5e69debbb7f0f29d7cb93333e80da 100644 (file)
@@ -130,16 +130,6 @@ public class HyperlinkRecord extends Record {
 
     }
 
-    /**
-     * Read hyperlink from input stream
-     *
-     * @param in the stream to read from
-     */
-    public HyperlinkRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
     /**
      * Return the column of the first cell that contains the hyperlink
      *
@@ -315,7 +305,7 @@ public class HyperlinkRecord extends Record {
     /**
      * @param in the RecordInputstream to read the record from
      */
-    protected void fillFields(RecordInputStream in)
+    public HyperlinkRecord(RecordInputStream in)
     {
         try {
             rwFirst = in.readShort();
index d997a43dd83ac4494ed518460824b301918db46b..c7c3cfbb5afea00e19c75a9cc11eefb7164fa747 100644 (file)
@@ -48,17 +48,7 @@ public class IndexRecord
     {
     }
 
-    /**
-     * Constructs an Index record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public IndexRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_5_dbcells       =
             new IntList(DBCELL_CAPACITY);   // initial capacity of 30
index 8f91b197eca68f5185edc704075b5d93e5963f47..2a9de8e5636e3b143c4c3e40ce27b35d8688790a 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    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;
 
 import org.apache.poi.util.LittleEndian;
 
 /**
- * Title: Interface End Record<P>
+ * Title: Interface End Record (0x00E2)<P>
  * Description: Shows where the Interface Records end (MMS)
  *  (has no fields)<P>
  * REFERENCE:  PG 324 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @version 2.0-pre
  */
-
-public class InterfaceEndRecord
-    extends Record
-{
-    public final static short sid = 0xe2;
+public final class InterfaceEndRecord extends Record {
+    public final static short sid = 0x00E2;
 
     public InterfaceEndRecord()
     {
     }
 
     /**
-     * Constructs an InterfaceEnd record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
+     * @param in unused (since this record has no data)
      */
-
     public InterfaceEndRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
     }
 
index 5e04b506ab7d956159c10d4a6ef119190a2dd779..617e95855fcbee3220c3af50e14cac827c16a6e3 100644 (file)
@@ -45,17 +45,7 @@ public class InterfaceHdrRecord
     {
     }
 
-    /**
-     * Constructs an Codepage record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public InterfaceHdrRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_codepage = in.readShort();
     }
index 82e167f79e793ca5ad6283612a793d88db74eb2c..400ee0a8c5eb40bf623b1f7d3b5097cda6680b7f 100644 (file)
@@ -43,17 +43,7 @@ public class IterationRecord
     {
     }
 
-    /**
-     * Constructs an Iteration record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public IterationRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_iteration = in.readShort();
     }
index 32b910b841a4e6263725738e627a4f4b3d6b623e..f4bbfb85dadd195323e71dd1b2db9244b0dfae85 100644 (file)
@@ -44,19 +44,9 @@ public final class LabelRecord extends Record implements CellValueRecordInterfac
     }
 
     /**
-     * Constructs an Label record and sets its fields appropriately.
-     *
      * @param in the RecordInputstream to read the record from
      */
     public LabelRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    /**
-     * @param in the RecordInputstream to read the record from
-     */
-    protected void fillFields(RecordInputStream in)
     {
         field_1_row          = in.readUShort();
         field_2_column       = in.readShort();
index 3d878770d4c3475884caabb0f77514a0f82999af..f2eae83debe95bd1032de991a0a549ebc0c4f245 100644 (file)
@@ -40,16 +40,7 @@ public final class LabelSSTRecord extends Record implements CellValueRecordInter
     {
     }
 
-    /**
-     * Constructs an LabelSST record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
     public LabelSSTRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_row       = in.readUShort();
         field_2_column    = in.readUShort();
index ebe59a3376294950d24c0b39b0adc6609d1d8d7b..92da85ceaa567ddc28d4327ed20deceade1af757 100644 (file)
@@ -31,15 +31,7 @@ public class LeftMarginRecord extends Record implements Margin
 
     public LeftMarginRecord()    {    }
 
-    /**
-     * Constructs a LeftMargin record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
     public LeftMarginRecord(RecordInputStream in)
-    {        super(in);    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_margin = in.readDouble();
     }
@@ -93,4 +85,4 @@ public class LeftMarginRecord extends Record implements Margin
         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
index 46ccd6b6595d4ba2a1a7e4cafaf9d004ae58c443..08ff6513fc8a69731a24766e4e7de391f0802e94 100644 (file)
@@ -62,19 +62,7 @@ public final class LegendRecord extends Record {
 
     }
 
-    /**
-     * Constructs a Legend record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public LegendRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_xAxisUpperLeft         = in.readInt();
         field_2_yAxisUpperLeft         = in.readInt();
index 88fafe10a203bdbc1fb41b2b6df8c3824df9e63f..c3f0197f389b5aca47f862ed668cef8958d10441 100644 (file)
@@ -61,19 +61,7 @@ public final class LineFormatRecord extends Record {
 
     }
 
-    /**
-     * Constructs a LineFormat record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public LineFormatRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_lineColor              = in.readInt();
         field_2_linePattern            = in.readShort();
index be5d1fd8416af6d5af3facca72b6a7627c3f2f84..9e82adec6eea16cbcf9556c7c0ce133747fbf440 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -31,9 +29,7 @@ import java.util.Iterator;
  *
  * @author Glen Stampoultzis (glens at apache.org)
  */
-public class LinkedDataFormulaField
-        implements CustomField
-{
+public final class LinkedDataFormulaField implements CustomField {
     Stack formulaTokens = new Stack();
 
     public int getSize()
index 6e0dc8296a8e6dc50bdf5f855588bffe188c7c36..673fc85f4be25481b8c2e5d1e68479b085fa2cec 100644 (file)
@@ -54,19 +54,7 @@ public final class LinkedDataRecord extends Record {
 
     }
 
-    /**
-     * Constructs a LinkedData record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public LinkedDataRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_linkType               = in.readByte();
         field_2_referenceType          = in.readByte();
@@ -142,7 +130,7 @@ public final class LinkedDataRecord extends Record {
         rec.field_2_referenceType = field_2_referenceType;
         rec.field_3_options = field_3_options;
         rec.field_4_indexNumberFmtRecord = field_4_indexNumberFmtRecord;
-        rec.field_5_formulaOfLink = ((LinkedDataFormulaField)field_5_formulaOfLink.clone());;
+        rec.field_5_formulaOfLink = ((LinkedDataFormulaField)field_5_formulaOfLink.clone());
         return rec;
     }
 
index 3ee9665692dd440ad7f76510ae0d7e3979ef633c..c11e2d510d16bb4ae2e3be27f995358802e7bacf 100644 (file)
@@ -41,17 +41,7 @@ public class MMSRecord
     {
     }
 
-    /**
-     * Constructs a MMS record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public MMSRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_addMenuCount = in.readByte();
         field_2_delMenuCount = in.readByte();
index aac11ef6037159f7fc0f3d43954c9f046f1b5bec..5c7da42aa9f256271ce82a497d13f5a777da93ed 100644 (file)
@@ -56,9 +56,6 @@ public final class MergeCellsRecord extends Record {
        _startIndex = 0;
        _regions = cras;
     }
-    protected void fillFields(RecordInputStream in) {
-       throw new RuntimeException("obsolete");
-    }
     /**
      * get the number of merged areas.  If this drops down to 0 you should just go
      * ahead and delete the record.
index 0bfeea9ffc49ec920881171f99fff36255c6682e..8d461fe975bdaf7639d3a721f51fe87b2fdc09da 100644 (file)
@@ -52,17 +52,6 @@ public class MulBlankRecord
     {
     }
 
-    /**
-     * Constructs a MulBlank record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
-    public MulBlankRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
     /**
      * get the row number of the cells this represents
      *
@@ -119,7 +108,7 @@ public class MulBlankRecord
     /**
      * @param in the RecordInputstream to read the record from
      */
-    protected void fillFields(RecordInputStream in)
+    public MulBlankRecord(RecordInputStream in)
     {
         //field_1_row       = LittleEndian.getShort(data, 0 + offset);
         field_1_row       = in.readUShort();
index 4f2981f5da6b8774b02c6c0c6975d6579943bf00..0419f4921dcdff15f7d8dd595a546b1d76b9d86b 100644 (file)
@@ -37,15 +37,6 @@ public final class MulRKRecord extends Record {
        private RkRec[] field_3_rks;
        private short   field_4_last_col;
 
-       /**
-        * Constructs a MulRK record and sets its fields appropriately.
-        *
-        * @param in the RecordInputstream to read the record from
-        */
-       public MulRKRecord(RecordInputStream in) {
-               super(in);
-       }
-
        public int getRow() {
                return field_1_row;
        }
@@ -93,7 +84,7 @@ public final class MulRKRecord extends Record {
        /**
         * @param in the RecordInputstream to read the record from
         */
-       protected void fillFields(RecordInputStream in) {
+       public MulRKRecord(RecordInputStream in) {
                field_1_row = in.readUShort();
                field_2_first_col = in.readShort();
                field_3_rks = RkRec.parseRKs(in);
index 732172add76ec9749e8b540be2c752d43b01a499..93f4ce6cd76d7b87f69c08b71b68bc00e2df35c9 100644 (file)
@@ -107,15 +107,6 @@ public final class NameRecord extends Record {
                field_17_status_bar_text = "";
        }
 
-       /**
-        * Constructs a Name record and sets its fields appropriately.
-        *
-        * @param in the RecordInputstream to read the record from
-        */
-       public NameRecord(RecordInputStream in) {
-               super(in);
-       }
-
        /**
         * Constructor to create a built-in named region
         * @param builtin Built-in byte representation for the name record, use the public constants
@@ -539,7 +530,7 @@ public final class NameRecord extends Record {
         *
         * @param in the RecordInputstream to read the record from
         */
-       protected void fillFields(RecordInputStream in) {
+       public NameRecord(RecordInputStream in) {
                field_1_option_flag                 = in.readShort();
                field_2_keyboard_shortcut           = in.readByte();
                int field_3_length_name_text        = in.readByte();
index c37bd08545f4049ef3cd0875804d57dc7e5568ee..2f506f115d7212061cde4e53058ebdab5384950e 100644 (file)
@@ -53,18 +53,6 @@ public class NoteRecord extends Record {
         field_3_flags = 0;
     }
 
-    /**
-     * Constructs a <code>NoteRecord</code> and fills its fields
-     * from the supplied <code>RecordInputStream</code>.
-     *
-     * @param in the stream to read from
-     */
-    public NoteRecord(RecordInputStream in)
-    {
-        super(in);
-
-    }
-
     /**
      * @return id of this record.
      */
@@ -76,7 +64,7 @@ public class NoteRecord extends Record {
     /**
      * Read the record data from the supplied <code>RecordInputStream</code>
      */
-    protected void fillFields(RecordInputStream in)
+    public NoteRecord(RecordInputStream in)
     {
         field_1_row = in.readShort();
         field_2_col = in.readShort();
index a0b519594c07b2e5af35a5b86967afcc36d23edd..4b96a0ee4524e189c5ede5b68b5f67d39bc379af 100644 (file)
@@ -45,20 +45,10 @@ public class NoteStructureSubRecord
         reserved = new byte[22];
     }
 
-    /**
-     * Constructs a NoteStructureSubRecord and sets its fields appropriately.
-     *
-     */
-    public NoteStructureSubRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
     /**
      * Read the record data from the supplied <code>RecordInputStream</code>
      */
-    protected void fillFields(RecordInputStream in)
+    public NoteStructureSubRecord(RecordInputStream in)
     {
         //just grab the raw data
         reserved = in.readRemainder();
index 951e53360a658ba8c7cedbd301e104d5df44fd02..00307e141f902d83122a42d026ab176140326d42 100644 (file)
@@ -42,19 +42,7 @@ public class NumberFormatIndexRecord
 
     }
 
-    /**
-     * Constructs a NumberFormatIndex record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public NumberFormatIndexRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_formatIndex            = in.readShort();
     }
index 0877985adc58b6872df95d0dbbbc8e097d6b6a59..e4283f0eac722acbde6fcb258e592a8cd6b9d6a9 100644 (file)
@@ -41,19 +41,9 @@ public final class NumberRecord extends Record implements CellValueRecordInterfa
     }
 
     /**
-     * Constructs a Number record and sets its fields appropriately.
-     *
      * @param in the RecordInputstream to read the record from
      */
     public NumberRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    /**
-     * @param in the RecordInputstream to read the record from
-     */
-    protected void fillFields(RecordInputStream in)
     {
         field_1_row   = in.readUShort();
         field_2_col   = in.readUShort();
index 0e85817a2b4bc1357031f3e56835616e47537d93..03ea7d1f5581d0c9e6ef5c35e214d1bd7a6e98ea 100644 (file)
@@ -43,18 +43,7 @@ public final class ObjRecord extends Record {
         // TODO - ensure 2 sub-records (ftCmo  15h, and ftEnd  00h) are always created
     }
 
-    /**
-     * Constructs a OBJ record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ObjRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
        // TODO - problems with OBJ sub-records stream
        // MS spec says first sub-records is always CommonObjectDataSubRecord, and last is 
index ec32ef0fa7c22869bc2ca341a6a73d547d56cbad..7a86fe2ec44a0cf037b949a27d1026782631d8f0 100644 (file)
@@ -49,19 +49,7 @@ public class ObjectLinkRecord
 
     }
 
-    /**
-     * Constructs a ObjectLink record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ObjectLinkRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_anchorId               = in.readShort();
         field_2_link1                  = in.readShort();
index 0dbb95c21e91a4d6804b1ddd440f54c2fb3d975f..cdbb56d8731900e234cd34577b03543d9ead194a 100644 (file)
@@ -41,17 +41,7 @@ public class ObjectProtectRecord
     {
     }
 
-    /**
-     * Constructs a Protect record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ObjectProtectRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_protect = in.readShort();
     }
index f11e3395cdaf27c722258ae4286436bd39b3a552..654439f31609cfbe5a6e9e97ddbff265ff96dcc2 100644 (file)
@@ -83,11 +83,7 @@ public abstract class PageBreakRecord extends Record {
         _breakMap = new HashMap();
     }
 
-    protected PageBreakRecord(RecordInputStream in) {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
+    public PageBreakRecord(RecordInputStream in)
     {
         int nBreaks = in.readShort();
         _breaks = new ArrayList(nBreaks + 2);
index 6fd4682173704b316ddf3b1a794f98262bdd9e8e..0cf78563619d9193bd47fe833b46191956daeba4 100644 (file)
@@ -48,17 +48,7 @@ public class PaletteRecord
       createDefaultPalette();
     }
 
-    /**
-     * Constructs a PaletteRecord record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PaletteRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
        field_1_numcolors = in.readShort();
        field_2_colors    = new ArrayList(field_1_numcolors);
index c8e4df55b680da1a01c3141db285b25f6be856a9..f02b0795b916a0db26e6df7311f43daef13cfe26 100644 (file)
@@ -49,19 +49,7 @@ public final class PaneRecord extends Record {
 
     }
 
-    /**
-     * Constructs a Pane record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PaneRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_x                      = in.readShort();
         field_2_y                      = in.readShort();
index 1b9e9041ac520d50d48db52f65a4628b79f97e82..b7b9d075ab300fe0c05249b608bc72ce61d7cd79 100644 (file)
@@ -36,16 +36,7 @@ public class PasswordRecord extends Record {
     public PasswordRecord() {
     }
 
-    /**
-     * Constructs a Password record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PasswordRecord(RecordInputStream in) {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in) {
         field_1_password = in.readShort();
     }
 
index 5a096b1d26135aa4c52d655445e5477d0dce053e..5c5567a86ba8a772b7a2b09673ca6faa4dfdf2c7 100644 (file)
@@ -40,17 +40,7 @@ public class PasswordRev4Record
     {
     }
 
-    /**
-     * Constructs a PasswordRev4 (PROT4REVPASS) record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PasswordRev4Record(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_password = in.readShort();
     }
index c41c3f2f7d6eb18fdfce478ddbd74c7080055210..e678eac782948c01bc92ed71159f2e24ae3cc51e 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    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;
 
-
-
-import org.apache.poi.util.*;
+import org.apache.poi.util.LittleEndian;
 
 /**
  * preceeds and identifies a frame as belonging to the plot area.
@@ -30,9 +26,7 @@ import org.apache.poi.util.*;
 
  * @author Andrew C. Oliver (acoliver at apache.org)
  */
-public class PlotAreaRecord
-    extends Record
-{
+public final class PlotAreaRecord extends Record {
     public final static short      sid                             = 0x1035;
 
 
@@ -42,18 +36,9 @@ public class PlotAreaRecord
     }
 
     /**
-     * Constructs a PlotArea record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
+     * @param in unused (since this record has no data)
      */
-
     public PlotAreaRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
 
     }
index b340fe604a35d9fbd83c8db59d17bd27d9832262..9df6811e2ab0a7130ed5aab69f60f3fda29fea92 100644 (file)
@@ -43,19 +43,7 @@ public class PlotGrowthRecord
 
     }
 
-    /**
-     * Constructs a PlotGrowth record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PlotGrowthRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_horizontalScale        = in.readInt();
         field_2_verticalScale          = in.readInt();
index 57e390df46c31db73c0bb424af6eaffca87e47b1..a147cfff18727d4875466b31289d624cdec3c0d4 100644 (file)
@@ -40,17 +40,7 @@ public class PrecisionRecord
     {
     }
 
-    /**
-     * Constructs a Precision record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PrecisionRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_precision = in.readShort();
     }
index 3908e01660bf5939aebbfe3dc19f9295a8e6605e..7b4de7c68e78d5952df97c983465d89d5317004d 100644 (file)
@@ -40,17 +40,7 @@ public class PrintGridlinesRecord
     {
     }
 
-    /**
-     * Constructs a PrintGridlines record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PrintGridlinesRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_print_gridlines = in.readShort();
     }
index 80521050c3a47929df7c78fe949bd879f3b2b390..61c1cce86eabb7d27af548345ac323133ae6aabe 100644 (file)
@@ -41,17 +41,7 @@ public class PrintHeadersRecord
     {
     }
 
-    /**
-     * Constructs a PrintHeaders record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PrintHeadersRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_print_headers = in.readShort();
     }
index 91ab614543a7111540ccd9fbbf8e0ad7626ceafe..e41f278d5411e26a2f7dde266561d7303f509530 100644 (file)
@@ -66,17 +66,7 @@ public class PrintSetupRecord extends Record {
     {
     }
 
-    /**
-     * Constructs a PrintSetup (SETUP) record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public PrintSetupRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_paper_size    = in.readShort();
         field_2_scale         = in.readShort();
index b6b5378c7469b0dc49f30f929a70aa9304a92ee7..d5425c55234823e9674da19410cd15409cc45f21 100644 (file)
@@ -42,17 +42,7 @@ public class ProtectRecord
     {
     }
 
-    /**
-     * Constructs a Protect record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ProtectRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_protect = in.readShort();
     }
index c0e650f4ecdce4aa904fd39584321573a788be72..b7d2f4323f37a68b93482ee0c74eb3539edda7e9 100644 (file)
@@ -40,17 +40,7 @@ public class ProtectionRev4Record
     {
     }
 
-    /**
-     * Constructs a ProtectionRev4 record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ProtectionRev4Record(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_protect = in.readShort();
     }
index b899df4651fab1f32ec9557e2a5f41b0d1ccc69e..c4b25a5bead8f9b71c512f0e5f3785349932cbfd 100644 (file)
@@ -52,16 +52,7 @@ public final class RKRecord extends Record implements CellValueRecordInterface {
     {
     }
 
-    /**
-     * Constructs a RK record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
     public RKRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_row       = in.readUShort();
         field_2_col       = in.readUShort();
index 008ee82e6d38d1800ee99ce2354fd89ad093fb6b..c0cab053c9a0584238ed0175ebf4670c2da78bbc 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -37,9 +35,7 @@ import org.apache.poi.util.LittleEndian;
  * @see org.apache.poi.hssf.model.Workbook
  */
 
-public class RecalcIdRecord
-    extends Record
-{
+public final class RecalcIdRecord extends Record {
     public final static short sid = 0x1c1;
     public short[]            field_1_recalcids;
 
@@ -49,17 +45,7 @@ public class RecalcIdRecord
     {
     }
 
-    /**
-     * Constructs a RECALCID record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public RecalcIdRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_recalcids = new short[ in.remaining() / 2 ];
         for (int k = 0; k < field_1_recalcids.length; k++)
@@ -118,9 +104,8 @@ public class RecalcIdRecord
         short   length     = ( short ) (tabids.length * 2);
         int     byteoffset = 4;
 
-        LittleEndian.putShort(data, 0 + offset, sid);
-        LittleEndian.putShort(data, 2 + offset,
-                              (( short ) length));
+        LittleEndian.putUShort(data, 0 + offset, sid);
+        LittleEndian.putUShort(data, 2 + offset, length);
 
         // 2 (num bytes in a short)
         for (int k = 0; k < (length / 2); k++)
index a18869f0730935916eaad99a9b538e54242ec0fc..29c37d7047b056c628c810b5730fbe16a2d3b385 100644 (file)
@@ -40,25 +40,6 @@ public abstract class Record extends RecordBase {
     {
     }
 
-    /**
-     * Constructor Record
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-    protected Record(RecordInputStream in)
-    {
-        fillFields(in);
-    }
-
-    /**
-     * called by the constructor, should set class level fields.  Should throw
-     * runtime exception for bad/icomplete data.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
-    protected abstract void fillFields(RecordInputStream in);
-
     /**
      * called by the class that is responsible for writing this sucker.
      * Subclasses should implement this so that their data is passed back in a
index 632d0d3b58ee05dd9ee94cce3e6ee4e170d38d7b..f0567509bfa57fc40d72de6ec5ddd32501c0012c 100644 (file)
@@ -42,17 +42,7 @@ public class RefModeRecord
     {
     }
 
-    /**
-     * Constructs a RefMode record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public RefModeRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_mode = in.readShort();
     }
index 624001beac1270f449e392d19cd4ad1d6a2ef78d..021a34c69be081ee891b29bf2d276b8785de5da1 100644 (file)
@@ -40,17 +40,7 @@ public class RefreshAllRecord
     {
     }
 
-    /**
-     * Constructs a RefreshAll record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public RefreshAllRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_refreshall = in.readShort();
     }
index 9e76010a347776ad0514a36b1224b342359fd761..75cdb2c2f3a97de36d771e2206b56f7cf836ee41 100644 (file)
@@ -30,13 +30,7 @@ public class RightMarginRecord extends Record implements Margin
 
     public RightMarginRecord()    {    }
 
-    /**
-     * Constructs a RightMargin record and sets its fields appropriately.     *     * @param id    id must be 0x27 or an exception     *              will be throw upon validation     * @param size  size the size of the data area of the record     * @param data  data of the record (should not contain sid/len)
-     */
     public RightMarginRecord( RecordInputStream in )
-    {        super( in );    }
-
-    protected void fillFields( RecordInputStream in )
     {
         field_1_margin = in.readDouble();
     }
@@ -82,4 +76,4 @@ public class RightMarginRecord extends Record implements Margin
         rec.field_1_margin = this.field_1_margin;
         return rec;
     }
-}  // END OF CLAS
\ No newline at end of file
+}  // END OF CLA
\ No newline at end of file
index a5e5cd1e85bf750c83d6c52f13f13ed0e092e0c2..f893bf2831ec533a0fc6d8646fbbfe7557458b4e 100644 (file)
@@ -74,16 +74,7 @@ public final class RowRecord extends Record {
         field_8_xf_index = ( short ) 0xf;
     }
 
-    /**
-     * Constructs a Row record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
     public RowRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_row_number   = in.readUShort();
         field_2_first_col    = in.readShort();
index 41cbdee165916f92888da20756d66b798085adda..7295ad61edc1a0bbee03d2a4ea71d79cae9ef04c 100644 (file)
@@ -43,19 +43,7 @@ public class SCLRecord
 
     }
 
-    /**
-     * Constructs a SCL record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SCLRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_numerator              = in.readShort();
         field_2_denominator            = in.readShort();
index 7f3477b63f0965778d6d3bc61b1d9a43ccd0e11a..ca75af00d4c64afc28582670290db5c4bdb012bd 100644 (file)
@@ -90,17 +90,6 @@ public class SSTRecord
         deserializer = new SSTDeserializer(field_3_strings);
     }
 
-    /**
-     * Constructs an SST record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
-    public SSTRecord( RecordInputStream in )
-    {
-        super( in );
-    }
-
     /**
      * Add a string.
      *
@@ -335,7 +324,7 @@ public class SSTRecord
      * @param in the RecordInputstream to read the record from
      */
 
-    protected void fillFields( RecordInputStream in )
+    public SSTRecord( RecordInputStream in )
     {
         // this method is ALWAYS called after construction -- using
         // the nontrivial constructor, of course -- so this is where
index 2304639dbddb44b6f29b82a591be414a873e59b6..9cf008fe18cc55639c942459813981c9cad46847 100644 (file)
@@ -40,17 +40,7 @@ public class SaveRecalcRecord
     {
     }
 
-    /**
-     * Constructs an SaveRecalc record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SaveRecalcRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_recalc = in.readShort();
     }
index 9140f342b8700da1e997bd99506d528aa3072645..037eed02067412361c21b20121013e754b731685 100644 (file)
@@ -42,17 +42,7 @@ public class ScenarioProtectRecord
     {
     }
 
-    /**
-     * Constructs a Protect record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ScenarioProtectRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_protect = in.readShort();
     }
index c83b3e4da6419ffcc4d234ea142c01515e98d31a..ca2bf22fc14e734ec46a25401b2bed8539d1d555 100644 (file)
@@ -51,15 +51,7 @@ public final class SelectionRecord extends Record {
         };
     }
 
-    /**
-     * Constructs a Selection record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
     public SelectionRecord(RecordInputStream in) {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in) {
         field_1_pane            = in.readByte();
         field_2_row_active_cell = in.readUShort();
         field_3_col_active_cell = in.readShort();
index ce1fa3d8382fb1cdc646071c61e067f33c5a022d..acc9665ae3490c5e31ded5404b0a01b2cdeda765 100644 (file)
@@ -42,19 +42,7 @@ public class SeriesChartGroupIndexRecord
 
     }
 
-    /**
-     * Constructs a SeriesChartGroupIndex record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SeriesChartGroupIndexRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_chartGroupIndex        = in.readShort();
     }
index 3f3f88803ed11bf60363aa3b03b7e4e91b510f59..6896a0a217f147b888d1408fc46ee8f34405f6a8 100644 (file)
@@ -42,19 +42,7 @@ public class SeriesIndexRecord
 
     }
 
-    /**
-     * Constructs a SeriesIndex record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SeriesIndexRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_index                  = in.readShort();
     }
index 8ee1690e698f85600fcea3977de0ffc3b6fd436f..a3e8089bfb6b8d2e133b1e0618cbf426b8b154ec 100644 (file)
@@ -46,19 +46,7 @@ public final class SeriesLabelsRecord extends Record {
 
     }
 
-    /**
-     * Constructs a SeriesLabels record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SeriesLabelsRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_formatFlags            = in.readShort();
     }
index d47f6b82bd09f031023db80272642bf935aed4b0..2894f158777a77d0108902aac251bcda82a9942f 100644 (file)
@@ -42,19 +42,7 @@ public class SeriesListRecord
 
     }
 
-    /**
-     * Constructs a SeriesList record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SeriesListRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_seriesNumbers          = in.readShortArray();
     }
index 95fbd79b5a5004d8c2a13de6ce4e47253d2e5fc3..34b3c94a662b3987f4cf2ed301fbc74920620d3f 100644 (file)
@@ -59,19 +59,7 @@ public class SeriesRecord
 
     }
 
-    /**
-     * Constructs a Series record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SeriesRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_categoryDataType       = in.readShort();
         field_2_valuesDataType         = in.readShort();
index b451b57c796028bf6582a551a761ac9e952a3d40..a445dc6166ace42bae1295e48be6a38797495cd2 100644 (file)
@@ -45,19 +45,7 @@ public class SeriesTextRecord
 
     }
 
-    /**
-     * Constructs a SeriesText record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SeriesTextRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_id                     = in.readShort();
         field_2_textLength             = in.readByte();
index 94877c6027cd98b8bbaacbaa556869af8e5ae105..ff69ec54692c764c8c018683935940b8d28cf34f 100644 (file)
@@ -42,19 +42,7 @@ public class SeriesToChartGroupRecord
 
     }
 
-    /**
-     * Constructs a SeriesToChartGroup record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SeriesToChartGroupRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_chartGroupIndex        = in.readShort();
     }
index fe4e8b5829b27baccd79f1352cfe6d0bb10f7535..fc51de8465de19aa0dadaf954568ca053c51a63e 100644 (file)
@@ -86,10 +86,6 @@ public abstract class SharedValueRecordBase extends Record {
                return dataSize + 4;
        }
 
-       protected final void fillFields(RecordInputStream in) {
-               throw new RuntimeException("Should not be called.  Fields are filled in constructor");
-       }
-
        /**
         * @return <code>true</code> if (rowIx, colIx) is within the range ({@link #getRange()})
         * of this shared value object.
index 1cd68335377d4f0f451336339f370d32f76e0e1b..9ae777e1e664624948a7c258eb310896ec75d7d0 100644 (file)
@@ -50,19 +50,7 @@ public final class SheetPropertiesRecord extends Record {
 
     }
 
-    /**
-     * Constructs a SheetProperties record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public SheetPropertiesRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_flags                  = in.readShort();
         field_2_empty                  = in.readByte();
index 41154b618530c631abe5ab4ff04e3fdf031ed450..e4e71f7db8e99fc9f060aec6e19a1c09a8c36b56 100644 (file)
@@ -36,20 +36,10 @@ public class StringRecord extends Record {
     {
     }
 
-    /**
-     * Constructs a String record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-    public StringRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
     /**
      * @param in the RecordInputstream to read the record from
      */
-    protected void fillFields( RecordInputStream in)
+    public StringRecord( RecordInputStream in)
     {
         field_1_string_length           = in.readShort();
         field_2_unicode_flag            = in.readByte();
index 3dc095431482b59897d94baa3b3d81c14a6042d2..5b746e8d4b7dba7f0e4d0f7d181c3e2c6d136555 100644 (file)
@@ -54,17 +54,7 @@ public final class StyleRecord extends Record {
     {
     }
 
-    /**
-     * Constructs a Style record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public StyleRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_xf_index = in.readShort();
         if (getType() == STYLE_BUILT_IN)
index 6b836c6ca6c18fa2d912916ccb8fc2d850587f63..1333ef19105b03a452e855774f4106b55a45b123 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    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;
 
 /**
  * Subrecords are part of the OBJ class.
  */
-abstract public class SubRecord
-        extends Record
-{
-    public SubRecord()
-    {
-    }
-
-    public SubRecord( RecordInputStream in )
-    {
-        super( in );
+abstract public class SubRecord extends Record {
+    protected SubRecord() {
     }
 
     public static Record createSubRecord(RecordInputStream in)
index 66fe24451d27654b85a3c67adeb26ee6214e0f3c..30e337e2d53a8e13c0b0d42873040732b4d67401 100644 (file)
@@ -66,17 +66,6 @@ public final class SupBookRecord extends Record {
         _isAddInFunctions = false;
     }
 
-    /**
-     * Constructs a Extern Sheet record and sets its fields appropriately.
-     *
-     * @param id     id must be 0x16 or an exception will be throw upon validation
-     * @param size  the size of the data area of the record
-     * @param data  data of the record (should not contain sid/len)
-     */
-    public SupBookRecord(RecordInputStream in) {
-        super(in);
-    }
-
     public boolean isExternalReferences() {
         return field_3_sheet_names != null;
     }
@@ -94,7 +83,7 @@ public final class SupBookRecord extends Record {
      * @param size size of data
      * @param offset of the record's data (provided a big array of the file)
      */
-    protected void fillFields(RecordInputStream in) {
+    public SupBookRecord(RecordInputStream in) {
         field_1_number_of_sheets = in.readShort();
         
         if(in.getLength() > SMALL_RECORD_SIZE) {
index 5e292c45f672d810e30f9f2c33c14a3d3d45d082..d5aca3e045315dc328549da6ca50365a9234658e 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -29,10 +27,7 @@ import org.apache.poi.util.LittleEndian;
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @version 2.0-pre
  */
-
-public class TabIdRecord
-    extends Record
-{
+public final class TabIdRecord extends Record {
     public final static short sid = 0x13d;
     public short[]            field_1_tabids;
 
@@ -40,17 +35,7 @@ public class TabIdRecord
     {
     }
 
-    /**
-     * Constructs a TabID record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public TabIdRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_tabids = new short[ in.remaining() / 2 ];
         for (int k = 0; k < field_1_tabids.length; k++)
@@ -97,13 +82,12 @@ public class TabIdRecord
 
     public int serialize(int offset, byte [] data)
     {
-        short[] tabids     = getTabIdArray();
-        short   length     = ( short ) (tabids.length * 2);
-        int     byteoffset = 4;
+        short[] tabids = getTabIdArray();
+        int length = tabids.length * 2;
+        int byteoffset = 4;
 
-        LittleEndian.putShort(data, 0 + offset, sid);
-        LittleEndian.putShort(data, 2 + offset,
-                              (( short ) length));   // nubmer tabids *
+        LittleEndian.putUShort(data, 0 + offset, sid);
+        LittleEndian.putUShort(data, 2 + offset, length);   // nubmer tabids *
 
         // 2 (num bytes in a short)
         for (int k = 0; k < (length / 2); k++)
index e8df518c97572d8de7872eb2b486606552d54ebb..8a27d163dac90718ce93e0dc57bae213ba022d8e 100644 (file)
@@ -69,19 +69,7 @@ public class TextObjectBaseRecord extends Record {
 
     }
 
-    /**
-     * Constructs a TextObjectBase record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public TextObjectBaseRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_options                = in.readShort();
         field_2_textOrientation        = in.readShort();
index 5201a7292b926cfc16c94c9f2df7a608b75f9e1c..600aaf1542c6d63e74c20aa85ea4beef28d8e12e 100644 (file)
 
 package org.apache.poi.hssf.record;
 
+import java.io.UnsupportedEncodingException;
+
 import org.apache.poi.hssf.usermodel.HSSFRichTextString;
-import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.HexDump;
-import java.io.UnsupportedEncodingException;
-import java.io.ByteArrayOutputStream;
+import org.apache.poi.util.LittleEndian;
 
 public class TextObjectRecord
         extends TextObjectBaseRecord
@@ -35,13 +35,7 @@ public class TextObjectRecord
     public TextObjectRecord( RecordInputStream in )
     {
         super( in );
-        if (str == null)
-               str = new HSSFRichTextString("");
-    }
 
-    protected void fillFields(RecordInputStream in)
-    {
-        super.fillFields(in);
         if (getTextLength() > 0) {
         if (in.isContinueNext() && in.remaining() == 0) {
             //1st Continue
@@ -56,6 +50,8 @@ public class TextObjectRecord
                 processFontRuns(in);
             } else throw new RecordFormatException("Expected Continue Record to hold font runs for TextObjectRecord");
         }
+        if (str == null)
+               str = new HSSFRichTextString("");
     }
 
 
index 7ef94f27a94922593a2009f0c87fd6789f6f0545..60c05e6d0a71403fab09be8afd0fad54bd5a8527 100644 (file)
@@ -93,19 +93,7 @@ public final class TextRecord extends Record {
 
     }
 
-    /**
-     * Constructs a Text record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public TextRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_horizontalAlignment    = in.readByte();
         field_2_verticalAlignment      = in.readByte();
index e3230d1dca081fd6527694955e28f059b0af179f..7e216156c67ff7eaa929cc05b7ff7cccdb9f90b3 100644 (file)
@@ -56,19 +56,7 @@ public final class TickRecord extends Record {
 
     }
 
-    /**
-     * Constructs a Tick record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public TickRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
 
         field_1_majorTickType          = in.readByte();
index 78860616efba4158f9fd9783610ba574b54d2af4..d67509e6c6faa3f9f8ceb1dcd71447da1842163a 100644 (file)
@@ -33,17 +33,9 @@ public class TopMarginRecord extends Record implements Margin
     public TopMarginRecord()    {    }
 
     /**
-     * Constructs a TopMargin record and sets its fields appropriately.
-     *
      * @param in the RecordInputstream to read the record from
      */
     public TopMarginRecord( RecordInputStream in )
-    {        super( in );    }
-
-    /**
-     * @param in the RecordInputstream to read the record from
-     */
-    protected void fillFields( RecordInputStream in )
     {
         field_1_margin = in.readDouble();
     }
@@ -89,4 +81,4 @@ public class TopMarginRecord extends Record implements Margin
         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
index c4ca369f6b3cac9d0f00a533a8e66868c90dc107..adc2cdeb907bf80067fcda358f125521726f7c90 100644 (file)
@@ -37,19 +37,13 @@ public class UncalcedRecord extends Record
         */
        public UncalcedRecord() {
        }
-       /**
-        * read constructor
-        */
-       public UncalcedRecord(RecordInputStream in) {
-               super(in);
-       }
 
        public short getSid() {
                return sid;
        }
 
-       protected void fillFields(RecordInputStream in) {
-               short unused = in.readShort();
+       public UncalcedRecord(RecordInputStream in) {
+               in.readShort(); // unused
        }
 
        public String toString() {
@@ -60,9 +54,9 @@ public class UncalcedRecord extends Record
        }
 
        public int serialize(int offset, byte[] data) {
-               LittleEndian.putShort(data, 0 + offset, sid);
-               LittleEndian.putShort(data, 2 + offset, (short) 2);
-               LittleEndian.putShort(data, 4 + offset, (short) 0); // unused
+               LittleEndian.putUShort(data, 0 + offset, sid);
+               LittleEndian.putUShort(data, 2 + offset, 2);
+               LittleEndian.putUShort(data, 4 + offset, 0); // unused
                return getRecordSize();
        }
 
index 3cf35accd12a8f26be5968fd9d224c126332976a..4258d0a6d5164e2cc4000c3ef579e520a128181c 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -225,9 +223,7 @@ public class UnicodeString
               throw new RecordFormatException("Expected continue record.");
           }
           if (isCompressed) {
-            //Typecast direct to char from byte with high bit set causes all ones
-            //in the high byte of the char (which is of course incorrect)
-            char ch = (char)( (short)0xff & (short)in.readByte() );
+            char ch = (char)in.readUByte(); // avoid sex
             tmpString.append(ch);
           } else {
             char ch = (char) in.readShort();
index 84464376f8e37d93e61f6019ca335b44c34113b6..4295cfe79ba27877b1768148f72880a629d8d109 100644 (file)
@@ -42,18 +42,7 @@ public class UnitsRecord
 
     }
 
-    /**
-     * Constructs a Units record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
     public UnitsRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_units                  = in.readShort();
 
index 6f78f6ff5b2d87fba9e76d4bbdf90f6f316912cc..77de66d9b32fdfaf434b36ba39842e867cfc588c 100644 (file)
@@ -269,11 +269,6 @@ public final class UnknownRecord extends Record {
                return false;
        }
 
-       protected final void fillFields(RecordInputStream in) {
-               throw new RecordFormatException(
-                               "Unknown record cannot be constructed via offset -- we need a copy of the data");
-       }
-
        public final Object clone() {
                // immutable - ok to return this
                return this;
index 9b2e25e527c1e4462717aced60b3bb9d0922e9f2..8e64ef3d4a6fe86af3372add461427b12a9ad022 100644 (file)
@@ -42,17 +42,7 @@ public class UseSelFSRecord
     {
     }
 
-    /**
-     * Constructs a UseSelFS record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public UseSelFSRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_flag = in.readShort();
     }
index 5df785caa3583e1342f031286e3cd08501475b27..7326a3292903015e16d79f165142bac0a3ea647f 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -30,27 +28,15 @@ import org.apache.poi.util.LittleEndian;
  * @version 2.0-pre
  */
 
-public class VCenterRecord
-    extends Record
-{
+public final class VCenterRecord extends Record {
     public final static short sid = 0x84;
-    private short             field_1_vcenter;
+    private int field_1_vcenter;
 
     public VCenterRecord()
     {
     }
 
-    /**
-     * Constructs a VCENTER record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public VCenterRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_vcenter = in.readShort();
     }
@@ -62,14 +48,7 @@ public class VCenterRecord
 
     public void setVCenter(boolean hc)
     {
-        if (hc == true)
-        {
-            field_1_vcenter = 1;
-        }
-        else
-        {
-            field_1_vcenter = 0;
-        }
+       field_1_vcenter = hc ? 1 : 0;
     }
 
     /**
@@ -95,9 +74,9 @@ public class VCenterRecord
 
     public int serialize(int offset, byte [] data)
     {
-        LittleEndian.putShort(data, 0 + offset, sid);
-        LittleEndian.putShort(data, 2 + offset, ( short ) 0x2);
-        LittleEndian.putShort(data, 4 + offset, ( short ) field_1_vcenter);
+        LittleEndian.putUShort(data, 0 + offset, sid);
+        LittleEndian.putUShort(data, 2 + offset, 0x2);
+        LittleEndian.putUShort(data, 4 + offset, field_1_vcenter);
         return getRecordSize();
     }
 
index c7c07cfe65733f8dd6f42fcaa0d0190c21057758..bc5023212c09683ea26aa0fa934d4d0e436e0dd3 100644 (file)
@@ -55,19 +55,7 @@ public final class ValueRangeRecord extends Record {
 
     }
 
-    /**
-     * Constructs a ValueRange record and sets its fields appropriately.
-     *
-     * @param in the RecordInputstream to read the record from
-     */
-
     public ValueRangeRecord(RecordInputStream in)
-    {
-        super(in);
-    
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_minimumAxisValue       = in.readDouble();
         field_2_maximumAxisValue       = in.readDouble();
index 9a4f3dd2095011523a28051ebd01fb8a8f7d4265..bdb1cb4847868bac8212b3b8eabb218b7042fc3c 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -33,55 +31,33 @@ import org.apache.poi.util.LittleEndian;
  * @author Jason Height (jheight at chariot dot net dot au)
  * @version 2.0-pre
  */
-
-public class WSBoolRecord
-    extends Record
-{
+public final class WSBoolRecord extends Record {
     public final static short     sid = 0x81;
     private byte                  field_1_wsbool;         // crappy names are because this is really one big short field (2byte)
-    private byte                  field_2_wsbool;         // but the docs inconsistantly use it as 2 seperate bytes
+    private byte                  field_2_wsbool;         // but the docs inconsistently use it as 2 separate bytes
 
-    // I decided to be consistant in this way.
-    static final private BitField autobreaks          =
-        BitFieldFactory.getInstance(0x01);                               // are automatic page breaks visible
+    // I decided to be consistent in this way.
+    private static final BitField autobreaks    = BitFieldFactory.getInstance(0x01); // are automatic page breaks visible
 
     // bits 1 to 3 unused
-    static final private BitField dialog              =
-        BitFieldFactory.getInstance(0x10);                               // is sheet dialog sheet
-    static final private BitField applystyles         =
-        BitFieldFactory.getInstance(0x20);                               // whether to apply automatic styles to outlines
-    static final private BitField rowsumsbelow        = BitFieldFactory.getInstance(
-        0x40);                                            // whether summary rows will appear below detail in outlines
-    static final private BitField rowsumsright        = BitFieldFactory.getInstance(
-        0x80);                                            // whether summary rows will appear right of the detail in outlines
-    static final private BitField fittopage           =
-        BitFieldFactory.getInstance(0x01);                               // whether to fit stuff to the page
+    private static final BitField dialog        = BitFieldFactory.getInstance(0x10); // is sheet dialog sheet
+    private static final BitField applystyles   = BitFieldFactory.getInstance(0x20); // whether to apply automatic styles to outlines
+    private static final BitField rowsumsbelow  = BitFieldFactory.getInstance(0x40); // whether summary rows will appear below detail in outlines
+    private static final BitField rowsumsright  = BitFieldFactory.getInstance(0x80); // whether summary rows will appear right of the detail in outlines
+    private static final BitField fittopage     = BitFieldFactory.getInstance(0x01); // whether to fit stuff to the page
 
     // bit 2 reserved
-    static final private BitField displayguts         = BitFieldFactory.getInstance(
-        0x06);                                            // whether to display outline symbols (in the gutters)
+    private static final BitField displayguts   = BitFieldFactory.getInstance(0x06); // whether to display outline symbols (in the gutters)
 
     // bits 4-5 reserved
-    static final private BitField alternateexpression =   // whether to use alternate expression eval
-        BitFieldFactory.getInstance(0x40);
-    static final private BitField alternateformula    =   // whether to use alternate formula entry
-        BitFieldFactory.getInstance(0x80);
+    private static final BitField alternateexpression = BitFieldFactory.getInstance(0x40); // whether to use alternate expression eval
+    private static final BitField alternateformula    = BitFieldFactory.getInstance(0x80); // whether to use alternate formula entry
 
     public WSBoolRecord()
     {
     }
 
-    /**
-     * Constructs a WSBool record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public WSBoolRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
        byte data[] = in.readRemainder();
         field_1_wsbool =
index 91f9cbd6479a685e303719a9673acd23c39849bb..7afc5fa1f893ab5ac66a793f999f0a01b57413eb 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,6 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-        
 
 package org.apache.poi.hssf.record;
 
@@ -32,10 +30,7 @@ import org.apache.poi.util.LittleEndian;
  * @author Andrew C. Oliver (acoliver at apache dot org)
  * @version 2.0-pre
  */
-
-public class WindowOneRecord
-    extends Record
-{
+public final class WindowOneRecord extends Record {
     public final static short     sid = 0x3d;
 
     // our variable names stolen from old TV sets.
@@ -66,17 +61,7 @@ public class WindowOneRecord
     {
     }
 
-    /**
-     * Constructs a WindowOne record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public WindowOneRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_h_hold            = in.readShort();
         field_2_v_hold            = in.readShort();
index 7f7b423363d2be35611cd26cc552ec33a8b4e860..13d54e9b5e3dc3e6816b59e19a9a97352182cb55 100644 (file)
@@ -39,17 +39,7 @@ public class WindowProtectRecord
     {
     }
 
-    /**
-     * Constructs a WindowProtect record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public WindowProtectRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         field_1_protect = in.readShort();
     }
index 012a9e22ee743d3b3f3de809c5a4e25e65fb910e..9023d2d6920534268fc834781f63291ce0a3f7c0 100644 (file)
@@ -61,17 +61,7 @@ public final class WindowTwoRecord extends Record {
     {
     }
 
-    /**
-     * Constructs a WindowTwo record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public WindowTwoRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
       int size = in.remaining();
         field_1_options      = in.readShort();
index a01953a50105f4e17138324b1e1ab3bbcf4597f4..d73687f1866a07f441cf4c72bdd3a3c7656c7da3 100644 (file)
@@ -42,17 +42,7 @@ public class WriteAccessRecord
     {
     }
 
-    /**
-     * Constructs a WriteAccess record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
-     */
-
     public WriteAccessRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
         byte[] data = in.readRemainder();
         //The string is always 112 characters (padded with spaces), therefore
index 5cef19d6168b389a54a9f977a6f9b31b876417ff..eb27e0ec129dc3ec245c3bc60009e1183d582be5 100644 (file)
@@ -1,4 +1,3 @@
-
 /* ====================================================================
    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;
 
 import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.StringUtil;
 
 /**
  * Title:        Write Protect Record<P>
@@ -28,10 +25,7 @@ import org.apache.poi.util.StringUtil;
  * REFERENCE:  PG 425 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P>
  * @version 3.0-pre
  */
-
-public class WriteProtectRecord
-    extends Record
-{
+public final class WriteProtectRecord extends Record {
     public final static short sid = 0x86;
 
     public WriteProtectRecord()
@@ -39,16 +33,9 @@ public class WriteProtectRecord
     }
 
     /**
-     * Constructs a WriteAccess record and sets its fields appropriately.
-     * @param in the RecordInputstream to read the record from
+     * @param in unused (since this record has no data)
      */
-
     public WriteProtectRecord(RecordInputStream in)
-    {
-        super(in);
-    }
-
-    protected void fillFields(RecordInputStream in)
     {
     }
 
@@ -63,8 +50,8 @@ public class WriteProtectRecord
 
     public int serialize(int offset, byte [] data)
     {
-        LittleEndian.putShort(data, 0 + offset, sid);
-        LittleEndian.putShort(data, 2 + offset, (short)0);
+        LittleEndian.putUShort(data, 0 + offset, sid);
+        LittleEndian.putUShort(data, 2 + offset, 0);
 
         return getRecordSize();
     }
index 6fb08f4ee30857a7000c72005e08c321f615a202..4357c57e3b2e028afc1effec77422265411521ac 100644 (file)
@@ -498,18 +498,12 @@ public final class TestHSSFWorkbook extends TestCase {
         public BadlyBehavedRecord() {
             // 
         }
-        protected void fillFields(RecordInputStream in) {
-            throw new RuntimeException("Should not be called");
-        }
         public short getSid() {
             return 0x777;
         }
         public int serialize(int offset, byte[] data) {
             return 4;
         }
-        protected void validateSid(short id) {
-            throw new RuntimeException("Should not be called");
-        }
         public int getRecordSize() {
             return 8;
         }