Пример #1
0
  /**
   * Constructs a new data formatter. It takes a workbook to have access to the workbooks format
   * records.
   *
   * @param workbook the workbook the formats are tied to.
   */
  HSSFDataFormat(InternalWorkbook workbook) {
    _workbook = workbook;

    Iterator<FormatRecord> i = workbook.getFormats().iterator();
    while (i.hasNext()) {
      FormatRecord r = i.next();
      ensureFormatsSize(r.getIndexCode());
      _formats.set(r.getIndexCode(), r.getFormatString());
    }
  }
 /**
  * Process the record ourselves, but do not pass it on to the child Listener.
  *
  * @param record
  */
 public void processRecordInternally(Record record) {
   if (record instanceof FormatRecord) {
     FormatRecord fr = (FormatRecord) record;
     _customFormatRecords.put(Integer.valueOf(fr.getIndexCode()), fr);
   }
   if (record instanceof ExtendedFormatRecord) {
     ExtendedFormatRecord xr = (ExtendedFormatRecord) record;
     _xfRecords.add(xr);
   }
 }