| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.poi.hssf.usermodel.HSSFDataFormat
public class HSSFDataFormat
Utility to identify builtin formats. Now can handle user defined data formats also. The following is a list of the formats as returned by this class.
       0, "General"
       1, "0"
       2, "0.00"
       3, "#,##0"
       4, "#,##0.00"
       5, "($#,##0_);($#,##0)"
       6, "($#,##0_);[Red]($#,##0)"
       7, "($#,##0.00);($#,##0.00)"
       8, "($#,##0.00_);[Red]($#,##0.00)"
       9, "0%"
       0xa, "0.00%"
       0xb, "0.00E+00"
       0xc, "# ?/?"
       0xd, "# ??/??"
       0xe, "m/d/yy"
       0xf, "d-mmm-yy"
       0x10, "d-mmm"
       0x11, "mmm-yy"
       0x12, "h:mm AM/PM"
       0x13, "h:mm:ss AM/PM"
       0x14, "h:mm"
       0x15, "h:mm:ss"
       0x16, "m/d/yy h:mm"
// 0x17 - 0x24 reserved for international and undocumented 0x25, "(#,##0_);(#,##0)"
0x26, "(#,##0_);[Red](#,##0)"
0x27, "(#,##0.00_);(#,##0.00)"
0x28, "(#,##0.00_);[Red](#,##0.00)"
0x29, "_(*#,##0_);_(*(#,##0);_(* \"-\"_);_(@_)"
0x2a, "_($*#,##0_);_($*(#,##0);_($* \"-\"_);_(@_)"
0x2b, "_(*#,##0.00_);_(*(#,##0.00);_(*\"-\"??_);_(@_)"
0x2c, "_($*#,##0.00_);_($*(#,##0.00);_($*\"-\"??_);_(@_)"
0x2d, "mm:ss"
0x2e, "[h]:mm:ss"
0x2f, "mm:ss.0"
0x30, "##0.0E+0"
0x31, "@" - This is text format.
0x31 "text" - Alias for "@"
| Constructor Summary | |
|---|---|
HSSFDataFormat(Workbook workbook)
Construncts a new data formatter.  | 
|
| Method Summary | |
|---|---|
static java.lang.String | 
getBuiltinFormat(short index)
get the format string that matches the given format index  | 
static short | 
getBuiltinFormat(java.lang.String format)
get the format index that matches the given format string  | 
static java.util.List | 
getBuiltinFormats()
 | 
 java.lang.String | 
getFormat(short index)
get the format string that matches the given format index  | 
 short | 
getFormat(java.lang.String format)
Get the format index that matches the given format string, creating a new format entry if required.  | 
static int | 
getNumberOfBuiltinBuiltinFormats()
get the number of builtin and reserved builtinFormats  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public HSSFDataFormat(Workbook workbook)
workbook - the workbook the formats are tied to.| Method Detail | 
|---|
public static java.util.List getBuiltinFormats()
public static short getBuiltinFormat(java.lang.String format)
Automatically converts "text" to excel's format string to represent text.
format - string matching a built in format
public short getFormat(java.lang.String format)
format - string matching a built in format
public java.lang.String getFormat(short index)
index - of a format
public static java.lang.String getBuiltinFormat(short index)
index - of a built in format
ArrayOutOfBoundsException - when the index exceeds the number of builtin formats.public static int getNumberOfBuiltinBuiltinFormats()
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||