本文整理匯總了Java中org.apache.poi.hssf.record.FormatRecord類的典型用法代碼示例。如果您正苦於以下問題:Java FormatRecord類的具體用法?Java FormatRecord怎麽用?Java FormatRecord使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FormatRecord類屬於org.apache.poi.hssf.record包,在下文中一共展示了FormatRecord類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFormatString
import org.apache.poi.hssf.record.FormatRecord; //導入依賴的package包/類
/**
* Returns the format string, eg $##.##, for the given number format index.
*/
public String getFormatString(int formatIndex) {
String format = null;
if (formatIndex >= ExcelHSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) {
FormatRecord tfr = _customFormatRecords.get(Integer.valueOf(formatIndex));
if (tfr == null) {
logger.log( POILogger.ERROR, "Requested format at index " + formatIndex
+ ", but it wasn't found");
} else {
format = tfr.getFormatString();
}
} else {
format = ExcelHSSFDataFormat.getBuiltinFormat((short) formatIndex);
}
return format;
}
示例2: ExcelHSSFDataFormat
import org.apache.poi.hssf.record.FormatRecord; //導入依賴的package包/類
/**
* 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.
*/
ExcelHSSFDataFormat(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());
}
}
示例3: processRecordInternally
import org.apache.poi.hssf.record.FormatRecord; //導入依賴的package包/類
/**
* 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);
}
}