Package org.apache.poi.ss.usermodel
Class ExcelNumberFormat
- java.lang.Object
-
- org.apache.poi.ss.usermodel.ExcelNumberFormat
-
public class ExcelNumberFormat extends java.lang.Object
Object to hold a number format index and string, for various formatting evaluations
-
-
Constructor Summary
Constructors Constructor Description ExcelNumberFormat(int idx, java.lang.String format)
Use this carefully, prefer factory methods to ensure id/format relationships are not broken or confused.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExcelNumberFormat
from(Cell cell, ConditionalFormattingEvaluator cfEvaluator)
static ExcelNumberFormat
from(CellStyle style)
java.lang.String
getFormat()
int
getIdx()
-
-
-
Constructor Detail
-
ExcelNumberFormat
public ExcelNumberFormat(int idx, java.lang.String format)
Use this carefully, prefer factory methods to ensure id/format relationships are not broken or confused. Left public soConditionalFormattingRule.getNumberFormat()
implementations can use it.- Parameters:
idx
- Excel number format index, either a built-in or a higher custom # mapped in the workbook style tableformat
- Excel number format string for the index
-
-
Method Detail
-
from
public static ExcelNumberFormat from(CellStyle style)
- Parameters:
style
-- Returns:
- null if the style is null, instance from style data format values otherwise
-
from
public static ExcelNumberFormat from(Cell cell, ConditionalFormattingEvaluator cfEvaluator)
- Parameters:
cell
- cell to extract format fromcfEvaluator
- ConditionalFormattingEvaluator to use, or null if none in this context- 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
-
getIdx
public int getIdx()
- Returns:
- Excel number format index, either a built-in or a higher custom # mapped in the workbook style table
-
getFormat
public java.lang.String getFormat()
- Returns:
- Excel number format string for the index
-
-