当前位置: 首页>>代码示例>>Java>>正文


Java FormatRecord类代码示例

本文整理汇总了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;
}
 
开发者ID:bingyulei007,项目名称:bingexcel,代码行数:19,代码来源:ExcelFormatTrackingHSSFListener.java

示例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());
	}
}
 
开发者ID:bingyulei007,项目名称:bingexcel,代码行数:16,代码来源:ExcelHSSFDataFormat.java

示例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);
	}
}
 
开发者ID:bingyulei007,项目名称:bingexcel,代码行数:17,代码来源:ExcelFormatTrackingHSSFListener.java


注:本文中的org.apache.poi.hssf.record.FormatRecord类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。