Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.BOFRecord


        LastCellOfRowDummyRecord lc = (LastCellOfRowDummyRecord)record;
        log("Got end-of row, row was " + lc.getRow() + ", last column was " + lc.getLastColumnNumber());
      }
     
      if(record instanceof BOFRecord) {
        BOFRecord r = (BOFRecord)record;
        if(r.getType() == BOFRecord.TYPE_WORKSHEET) {
          log("On new sheet");
        }
      }
      if(record instanceof RowRecord) {
        RowRecord rr = (RowRecord)record;
View Full Code Here


   
    switch (record.getSid())
        {
            // the BOFRecord can represent either the beginning of a sheet or the workbook
            case BOFRecord.sid:
                BOFRecord bof = (BOFRecord) record;
                if (bof.getType() == bof.TYPE_WORKBOOK)
                {
                  // Reset the row and column counts - new workbook
                  lastRowRow = -1;
                  lastCellRow = -1;
                  lastCellColumn = -1;
                    //System.out.println("Encountered workbook");
                } else if (bof.getType() == bof.TYPE_WORKSHEET)
                {
                  // Reset the row and column counts - new sheet
                  lastRowRow = -1;
                  lastCellRow = -1;
                  lastCellColumn = -1;
View Full Code Here

        }

        private void internalProcessRecord(Record record) throws SAXException, TikaException, IOException {
            switch (record.getSid()) {
            case BOFRecord.sid: // start of workbook, worksheet etc. records
                BOFRecord bof = (BOFRecord) record;
                if (bof.getType() == BOFRecord.TYPE_WORKBOOK) {
                    currentSheetIndex = -1;
                } else if (bof.getType() == BOFRecord.TYPE_CHART) {
                    if(previousSid == EOFRecord.sid) {
                        // This is a sheet which contains only a chart
                        newSheet();
                    } else {
                        // This is a chart within a normal sheet
                        // Handling of this is a bit hacky...
                        if (currentSheet != null) {
                            processSheet();
                            currentSheetIndex--;
                            newSheet();
                        }
                    }
                } else if (bof.getType() == BOFRecord.TYPE_WORKSHEET) {
                    newSheet();
                }
                break;

            case EOFRecord.sid: // end of workbook, worksheet etc. records
View Full Code Here

        }

        private void internalProcessRecord(Record record) throws SAXException {
            switch (record.getSid()) {
            case BOFRecord.sid: // start of workbook, worksheet etc. records
                BOFRecord bof = (BOFRecord) record;
                if (bof.getType() == BOFRecord.TYPE_WORKBOOK) {
                    currentSheetIndex = -1;
                } else if (bof.getType() == BOFRecord.TYPE_WORKSHEET) {
                    currentSheetIndex++;
                    currentSheet =
                        new TreeMap<Point, Cell>(new PointComparator());
                }
                break;
View Full Code Here

                           (rec.getSid() == BOFRecord.sid));                 
                return true;             
            }
        }, new short[] {BOFRecord.sid});
       
        BOFRecord bof = new BOFRecord();
        bof.setBuild((short)0);
        bof.setBuildYear((short)1999);
        bof.setRequiredVersion(123);
        bof.setType(BOFRecord.TYPE_WORKBOOK);
        bof.setVersion((short)0x06);
        bof.setHistoryBitMask(BOFRecord.HISTORY_MASK);
       
        EOFRecord eof = new EOFRecord();
        bytes = new byte[bof.getRecordSize() + eof.getRecordSize()];
        offset = bof.serialize(offset,bytes);
        offset = eof.serialize(offset,bytes);
               
        factory.processRecords(new ByteArrayInputStream(bytes));   
        assertTrue("The record listener must be called",wascalled);   
    }
View Full Code Here

    public void testCreateRecord()
    {
        byte[] bytes = null;
        byte[] nbytes = null;
        Record[] records = null;
        BOFRecord bof = new BOFRecord();
        bof.setBuild((short)0);
        bof.setBuildYear((short)1999);
        bof.setRequiredVersion(123);
        bof.setType(BOFRecord.TYPE_WORKBOOK);
        bof.setVersion((short)0x06);
        bof.setHistoryBitMask(BOFRecord.HISTORY_MASK);
       
        bytes = bof.serialize();
        nbytes = new byte[bytes.length - 4];
        System.arraycopy(bytes,4,nbytes,0,nbytes.length);
           
        records = factory.createRecord(new TestcaseRecordInputStream(bof.getSid(),(short)nbytes.length,nbytes));
       
        assertTrue("record.length must be 1, was ="+records.length,records.length == 1);
        assertTrue("record is the same", compareRec(bof,records[0]));
       
    }
View Full Code Here

        }
        return retval;
    }

    private static BOFRecord createBOF() {
        BOFRecord retval = new BOFRecord();

        retval.setVersion(( short ) 0x600);
        retval.setType(BOFRecord.TYPE_WORKBOOK);
        retval.setBuild(( short ) 0x10d3);
        retval.setBuildYear(( short ) 1996);
        retval.setHistoryBitMask(0x41);   // was c1 before verify
        retval.setRequiredVersion(0x6);
        return retval;
    }
View Full Code Here

      case BoundSheetRecord.sid:
        BoundSheetRecord sr = (BoundSheetRecord)record;
        sheetNames.add(sr.getSheetname());
        break;
      case BOFRecord.sid:
        BOFRecord bof = (BOFRecord)record;
        if(bof.getType() == BOFRecord.TYPE_WORKSHEET) {
          sheetNum++;
          rowNum = -1;

          if(_includeSheetNames) {
            if(_text.length() > 0) _text.append("\n");
View Full Code Here

      switch (record.getSid()) {
        // the BOFRecord can represent either the beginning of a sheet or
        // the workbook
        case BOFRecord.sid:
          BOFRecord bof = (BOFRecord) record;
          if (bof.getType() == bof.TYPE_WORKBOOK || bof.getType() == bof.TYPE_WORKSHEET) {
            // Reset the row and column counts - new workbook / worksheet
            resetCounts();
          }
          break;
        case RowRecord.sid:
View Full Code Here

      case BoundSheetRecord.sid:
        BoundSheetRecord sr = (BoundSheetRecord)record;
        sheetNames.add(sr.getSheetname());
        break;
      case BOFRecord.sid:
        BOFRecord bof = (BOFRecord)record;
        if(bof.getType() == BOFRecord.TYPE_WORKSHEET) {
          sheetNum++;
          rowNum = -1;

          if(_includeSheetNames) {
            if(_text.length() > 0) _text.append("\n");
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.BOFRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.