Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.UnicodeString$UnicodeRecordStats


        this("");
    }

    public HSSFRichTextString(String string) {
        if (string == null) {
            _string = new UnicodeString("");
        } else {
            _string = new UnicodeString(string);
        }
    }
View Full Code Here


     *  be affected by changes that we make to this string.
     */
    private UnicodeString cloneStringIfRequired() {
      if (_book == null)
        return _string;
      UnicodeString s = (UnicodeString)_string.clone();
      return s;
    }
View Full Code Here

                 LabelRecord oldrec = ( LabelRecord ) rec;

                 records.remove(k);
                 LabelSSTRecord newrec   = new LabelSSTRecord();
                 int            stringid =
                     workbook.addSSTString(new UnicodeString(oldrec.getValue()));

                 newrec.setRow(oldrec.getRow());
                 newrec.setColumn(oldrec.getColumn());
                 newrec.setXFIndex(oldrec.getXFIndex());
                 newrec.setSSTIndex(stringid);
View Full Code Here

    /** @deprecated Do not call this method from your applications. Use the methods
     *  available in the HSSFRow to add string HSSFCells
     */
    public int addSSTString(String string)
    {
        return workbook.addSSTString(new UnicodeString(string));
    }
View Full Code Here

    public UnicodeString getSSTString(int str) {
        if (sst == null) {
            insertSST();
        }
        UnicodeString retval = sst.getString(str);

        if (log.check( POILogger.DEBUG ))
            log.log(DEBUG, "Returning SST for index=", new Integer(str),
                " String= ", retval);
        return retval;
View Full Code Here

  }

  private Object parseArrayItem() {
    SkipWhite();
    switch(look) {
      case '"': return new UnicodeString(parseStringLiteral());
      case '#': return ErrorConstant.valueOf(parseErrorLiteral());
      case 'F': case 'f':
      case 'T': case 't':
        return parseBooleanLiteral();
    }
View Full Code Here

              LittleEndian.putDouble(array, pos+offset, ((Double)o).doubleValue());
              pos+=8;
            } else if (o instanceof UnicodeString) {
              array[pos+offset] = 0x02;
              pos++;             
              UnicodeString s = (UnicodeString)o;
              //JMH TBD Handle string continuation. Id do it now but its 4am.
                  UnicodeString.UnicodeRecordStats stats = new UnicodeString.UnicodeRecordStats();
                  s.serialize(stats, pos + offset, array);
                  pos += stats.recordSize;
            } else throw new RuntimeException("Coding error");
          }
        }
        return pos;
View Full Code Here

    Object[] values = ptg.token_3_arrayValues;
    assertEquals(6, values.length);
   
   
    assertEquals(Boolean.TRUE, values[0]);
    assertEquals(new UnicodeString("ABCD"), values[1]);
    assertEquals(new Double(0), values[3]);
    assertEquals(Boolean.FALSE, values[4]);
    assertEquals(new UnicodeString("FG"), values[5]);
   
    byte[] outBuf = new byte[ENCODED_CONSTANT_DATA.length];
    ptg.writeTokenValueBytes(outBuf, 0);
   
    if(outBuf[0] == 4) {
View Full Code Here

    Class cls = object.getClass();
   
    if(cls == Boolean.class || cls == Double.class || cls == ErrorConstant.class) {
      return 8;
    }
    UnicodeString strVal = (UnicodeString)object;
    UnicodeRecordStats urs = new UnicodeRecordStats();
    strVal.getRecordSize(urs);
    return urs.recordSize;
  }
View Full Code Here

      LittleEndian.putByte(data, offset, TYPE_NUMBER);
      LittleEndian.putDouble(data, offset+1, dVal.doubleValue());
      return 9;
    }
    if (value instanceof UnicodeString) {
      UnicodeString usVal = (UnicodeString) value;
      LittleEndian.putByte(data, offset, TYPE_STRING);
      UnicodeRecordStats urs = new UnicodeRecordStats();
      usVal.serialize(urs, offset +1, data);
      return 1 + urs.recordSize;
    }
    if (value instanceof ErrorConstant) {
      ErrorConstant ecVal = (ErrorConstant) value;
      LittleEndian.putByte(data, offset, TYPE_ERROR_CODE);
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.UnicodeString$UnicodeRecordStats

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.