public class HSSFDataFormat
{
- private static Vector builtinFormats;
+ private static List builtinFormats = createBuiltinFormats();
private Vector formats = new Vector();
private Workbook workbook;
public HSSFDataFormat( Workbook workbook )
{
this.workbook = workbook;
- if ( builtinFormats == null ) populateBuiltinFormats();
Iterator i = workbook.getFormats().iterator();
while ( i.hasNext() )
{
}
- private static synchronized void populateBuiltinFormats()
+ private static synchronized List createBuiltinFormats()
{
- builtinFormats = new Vector();
+ List builtinFormats = new Vector();
builtinFormats.add( 0, "General" );
builtinFormats.add( 1, "0" );
builtinFormats.add( 2, "0.00" );
builtinFormats.add( 0x2f, "mm:ss.0" );
builtinFormats.add( 0x30, "##0.0E+0" );
builtinFormats.add( 0x31, "@" );
+ return builtinFormats;
}
public static List getBuiltinFormats()
{
- if ( builtinFormats == null )
- {
- populateBuiltinFormats();
- }
return builtinFormats;
}
if (format.toUpperCase().equals("TEXT"))
format = "@";
- if ( builtinFormats == null )
- {
- populateBuiltinFormats();
- }
short retval = -1;
for (short k = 0; k <= 0x31; k++)
public static String getBuiltinFormat( short index )
{
- if ( builtinFormats == null )
- {
- populateBuiltinFormats();
- }
return (String) builtinFormats.get( index );
}
public static int getNumberOfBuiltinBuiltinFormats()
{
- if ( builtinFormats == null )
- {
- populateBuiltinFormats();
- }
return builtinFormats.size();
}
}