當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。