Top Description Fields Constructors Methods
org.apache.poi.ss.usermodel

public Class ExcelNumberFormat

extends Object
Class Inheritance
Imports
java.util.List, org.apache.poi.ss.formula.ConditionalFormattingEvaluator, .EvaluationConditionalFormatRule

Object to hold a number format index and string, for various formatting evaluations

Field Summary

Modifier and TypeField and Description
private final String
private final int

Constructor Summary

AccessConstructor and Description
public
ExcelNumberFormat(int
Excel number format index, either a built-in or a higher custom # mapped in the workbook style table
idx
,
String
Excel number format string for the index
format
)

Use this carefully, prefer factory methods to ensure id/format relationships are not broken or confused.

Method Summary

Modifier and TypeMethod and Description
public static ExcelNumberFormat

Returns:

null if the style is null, instance from style data format values otherwise
from
(CellStyle style)

public static ExcelNumberFormat

Returns:

number format from highest-priority rule with a number format, or the cell style, or null if none of the above apply/are defined
from
(Cell
cell to extract format from
cell
,
ConditionalFormattingEvaluator
ConditionalFormattingEvaluator to use, or null if none in this context
cfEvaluator
)

public String

Returns:

Excel number format string for the index
getFormat
()

public int

Returns:

Excel number format index, either a built-in or a higher custom # mapped in the workbook style table
getIdx
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

formatback to summary
private final String format
idxback to summary
private final int idx

Constructor Detail

ExcelNumberFormatback to summary
public ExcelNumberFormat(int idx, String format)

Use this carefully, prefer factory methods to ensure id/format relationships are not broken or confused. Left public so ConditionalFormattingRule#getNumberFormat() implementations can use it.

Parameters
idx:int

Excel number format index, either a built-in or a higher custom # mapped in the workbook style table

format:String

Excel number format string for the index

Method Detail

fromback to summary
public static ExcelNumberFormat from(CellStyle style)
Returns:ExcelNumberFormat

null if the style is null, instance from style data format values otherwise

fromback to summary
public static ExcelNumberFormat from(Cell cell, ConditionalFormattingEvaluator cfEvaluator)
Parameters
cell:Cell

cell to extract format from

cfEvaluator:ConditionalFormattingEvaluator

ConditionalFormattingEvaluator to use, or null if none in this context

Returns:ExcelNumberFormat

number format from highest-priority rule with a number format, or the cell style, or null if none of the above apply/are defined

getFormatback to summary
public String getFormat()
Returns:String

Excel number format string for the index

getIdxback to summary
public int getIdx()
Returns:int

Excel number format index, either a built-in or a higher custom # mapped in the workbook style table