Package org.apache.poi.hssf.record

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


     * @see org.apache.poi.hssf.record.Record
     */
    public int createFormat(String formatString) {

        maxformatid = maxformatid >= 0xa4 ? maxformatid + 1 : 0xa4; //Starting value from M$ empircal study.
        FormatRecord rec = new FormatRecord(maxformatid, formatString);

        int pos = 0;
        while ( pos < records.size() && records.get( pos ).getSid() != FormatRecord.sid )
            pos++;
        pos += formats.size();
View Full Code Here


        retval.records.setFontpos( records.size() - 1 );   // last font record position
        retval.numfonts = 4;

        // set up format records
        for (int i = 0; i <= 7; i++) {
            FormatRecord rec = createFormat(i);
            retval.maxformatid = retval.maxformatid >= rec.getIndexCode() ? retval.maxformatid : rec.getIndexCode();
            formats.add(rec);
            records.add(rec);
        }

        for (int k = 0; k < 21; k++) {
View Full Code Here

        // we'll need multiple editions for
        // the different formats

       
        switch (id) {
            case 0: return new FormatRecord(5, BuiltinFormats.getBuiltinFormat(5));
            case 1: return new FormatRecord(6, BuiltinFormats.getBuiltinFormat(6));
            case 2: return new FormatRecord(7, BuiltinFormats.getBuiltinFormat(7));
            case 3: return new FormatRecord(8, BuiltinFormats.getBuiltinFormat(8));
            case 4: return new FormatRecord(0x2a, BuiltinFormats.getBuiltinFormat(0x2a));
            case 5: return new FormatRecord(0x29, BuiltinFormats.getBuiltinFormat(0x29));
            case 6: return new FormatRecord(0x2c, BuiltinFormats.getBuiltinFormat(0x2c));
            case 7: return new FormatRecord(0x2b, BuiltinFormats.getBuiltinFormat(0x2b));
        }
        throw new  IllegalArgumentException("Unexpected id " + id);
    }
View Full Code Here

     * @see org.apache.poi.hssf.record.Record
     */
    public int createFormat(String formatString) {

        maxformatid = maxformatid >= 0xa4 ? maxformatid + 1 : 0xa4; //Starting value from M$ empircal study.
        FormatRecord rec = new FormatRecord(maxformatid, formatString);

        int pos = 0;
        while ( pos < records.size() && records.get( pos ).getSid() != FormatRecord.sid )
            pos++;
        pos += formats.size();
View Full Code Here

    switch (record.getSid()) {
    case SSTRecord.sid:
      sstRecord = (SSTRecord) record;
      break;
    case FormatRecord.sid:
      FormatRecord fr = (FormatRecord) record;
      customFormatRecords.put(new Integer(fr.getIndexCode()), fr);
      break;
    case ExtendedFormatRecord.sid:
      ExtendedFormatRecord xr = (ExtendedFormatRecord) record;
      xfRecords.add(xr);
      break;
View Full Code Here

      return Double.toString(value);
    } else {
      int formatIndex = xfr.getFormatIndex();
      String format;
      if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) {
        FormatRecord tfr = (FormatRecord) customFormatRecords.get(new Integer(formatIndex));
        format = tfr.getFormatString();
      } else {
        format = HSSFDataFormat.getBuiltinFormat(xfr.getFormatIndex());
      }

      // Is it a date?
View Full Code Here

        {
    case SSTRecord.sid:
      sstRecord = (SSTRecord) record;
      break;
    case FormatRecord.sid:
      FormatRecord fr = (FormatRecord) record;
      customFormatRecords.put(new Integer(fr.getIndexCode()), fr);
      break;
    case ExtendedFormatRecord.sid:
      ExtendedFormatRecord xr = (ExtendedFormatRecord) record;
      xfRecords.add(xr);
      break;
View Full Code Here

            return Double.toString(value);
        } else {
          int formatIndex = xfr.getFormatIndex();
          String format;
          if(formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) {
            FormatRecord tfr = (FormatRecord)customFormatRecords.get(new Integer(formatIndex));
            format = tfr.getFormatString();
          } else {
              format = HSSFDataFormat.getBuiltinFormat(xfr.getFormatIndex());
          }
         
          // Is it a date?
View Full Code Here

        this.workbook = workbook;
        if ( builtinFormats == null ) populateBuiltinFormats();
        Iterator i = workbook.getFormats().iterator();
        while ( i.hasNext() )
        {
            FormatRecord r = (FormatRecord) i.next();
            if ( formats.size() < r.getIndexCode() + 1 )
            {
                formats.setSize( r.getIndexCode() + 1 );
            }
            formats.set( r.getIndexCode(), r.getFormatString() );
        }

    }
View Full Code Here

TOP

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

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.