/** * Quick and dirty function to return the contents of this cell as a string. * For more complex manipulation of the contents, it is necessary to cast * this interface to correct subinterface * * @return the contents of this cell as a string */ public String getContents() { if (format == null) { format = ( (XFRecord) getCellFormat()).getNumberFormat(); if (format == null) { format = defaultFormat; } } return format.format(value); }
/** * Quick and dirty function to return the contents of this cell as a string. * For more complex manipulation of the contents, it is necessary to cast * this interface to correct subinterface * * @return the contents of this cell as a string */ public String getContents() { if (format == null) { format = ( (XFRecord) getCellFormat()).getNumberFormat(); if (format == null) { format = defaultFormat; } } return format.format(value); }
/** * Gets the NumberFormat used to format the cell. * * @param pos the xf format index * @return the DateFormat object used to format the date in the original * excel cell */ public final NumberFormat getNumberFormat(int pos) { XFRecord xfr = (XFRecord) xfRecords.get(pos); if (xfr.isNumber()) { return xfr.getNumberFormat(); } FormatRecord fr = (FormatRecord) formats.get(new Integer(xfr.getFormatRecord())); if (fr == null) { return null; } return fr.isNumber() ? fr.getNumberFormat() : null; }
/** * Gets the NumberFormat used to format the cell. * * @param pos the xf format index * @return the DateFormat object used to format the date in the original * excel cell */ public final NumberFormat getNumberFormat(int pos) { XFRecord xfr = (XFRecord) xfRecords.get(pos); if (xfr.isNumber()) { return xfr.getNumberFormat(); } FormatRecord fr = (FormatRecord) formats.get(new Integer(xfr.getFormatRecord())); if (fr == null) { return null; } return fr.isNumber() ? fr.getNumberFormat() : null; }