Package org.apache.poi.hssf.usermodel
Class HSSFDataFormat
java.lang.Object
org.apache.poi.hssf.usermodel.HSSFDataFormat
- All Implemented Interfaces:
DataFormat
Identifies both built-in and user defined formats within a workbook.
See BuiltinFormats
for a list of supported built-in formats.
International Formats
Since version 2003 Excel has supported international formats. These are denoted
with a prefix "[$-xxx]" (where xxx is a 1-7 digit hexadecimal number).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getBuiltinFormat
(short index) get the format string that matches the given format indexstatic short
getBuiltinFormat
(String format) get the format index that matches the given format stringgetFormat
(short index) get the format string that matches the given format indexshort
Get the format index that matches the given format string, creating a new format entry if required.static int
get the number of built-in and reserved builtinFormats
-
Method Details
-
getBuiltinFormats
-
getBuiltinFormat
get the format index that matches the given format stringAutomatically converts "text" to excel's format string to represent text.
- Parameters:
format
- string matching a built in format- Returns:
- index of format or -1 if undefined.
-
getFormat
Get the format index that matches the given format string, creating a new format entry if required. Aliases text to the proper format as required.- Specified by:
getFormat
in interfaceDataFormat
- Parameters:
pFormat
- string matching a built in format- Returns:
- index of format.
-
getFormat
get the format string that matches the given format index- Specified by:
getFormat
in interfaceDataFormat
- Parameters:
index
- of a format- Returns:
- string represented at index of format or null if there is not a format at that index
-
getBuiltinFormat
get the format string that matches the given format index- Parameters:
index
- of a built in format- Returns:
- string represented at index of format or null if there is not a builtin format at that index
-
getNumberOfBuiltinBuiltinFormats
public static int getNumberOfBuiltinBuiltinFormats()get the number of built-in and reserved builtinFormats- Returns:
- number of built-in and reserved builtinFormats
-