本文整理汇总了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);
}
}