jxl
Class WorkbookSettings

java.lang.Object
  |
  +--jxl.WorkbookSettings

public final class WorkbookSettings
extends java.lang.Object

This is a bean which client applications may use to set various advanced workbook properties. Use of this bean is not mandatory, and its absence will merely result in workbooks being read/written using the default settings


Field Summary
private  int arrayGrowSize
          The amount of memory allocated to the array containing the workbook data when its current amount is exhausted.
private  boolean chartsDisabled
          Flag to indicate whether the chart feature is enabled or not Charts deactivated using -Djxl.nocharts=true on the JVM command line Activated by default or by using -Djxl.nocharts=false on the JVM command line
private static int defaultArrayGrowSize
           
private static int defaultInitialFileSize
           
private  boolean gcDisabled
          Flag to indicate whether the system hint garbage collection is enabled or not.
private  int initialFileSize
          The amount of memory allocated to store the workbook data when reading a worksheet.
private  java.util.Locale locale
          The locale.
private  boolean namesDisabled
          Flag to indicate whether the name feature is enabled or not Names deactivated using -Djxl.nonames=true on the JVM command line Activated by default or by using -Djxl.nonames=false on the JVM command line
 
Constructor Summary
WorkbookSettings()
          Default constructor
 
Method Summary
 int getArrayGrowSize()
          Accessor for the array grow size property
 boolean getChartsDisabled()
          Gets the charts disabled flag
 boolean getGCDisabled()
          Accessor for the disabling of garbage collection
 int getInitialFileSize()
          Accessor for the initial file size property
 java.util.Locale getLocale()
          Returns the locale used for the spreadsheet
 boolean getNamesDisabled()
          Accessor for the disabling of interpretation of named ranges
 void setArrayGrowSize(int sz)
          Sets the amount of memory by which to increase the amount of memory allocated to storing the workbook data.
 void setInitialFileSize(int sz)
          Sets the initial amount of memory allocated to store the workbook data when reading a worksheet.
 void setLocale(java.util.Locale l)
          Sets the locale for this spreadsheet
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

initialFileSize

private int initialFileSize
The amount of memory allocated to store the workbook data when reading a worksheet. For processeses reading many small workbooks inside a WAS it might be necessary to reduce the default size

arrayGrowSize

private int arrayGrowSize
The amount of memory allocated to the array containing the workbook data when its current amount is exhausted.

chartsDisabled

private boolean chartsDisabled
Flag to indicate whether the chart feature is enabled or not Charts deactivated using -Djxl.nocharts=true on the JVM command line Activated by default or by using -Djxl.nocharts=false on the JVM command line

namesDisabled

private boolean namesDisabled
Flag to indicate whether the name feature is enabled or not Names deactivated using -Djxl.nonames=true on the JVM command line Activated by default or by using -Djxl.nonames=false on the JVM command line

gcDisabled

private boolean gcDisabled
Flag to indicate whether the system hint garbage collection is enabled or not. As a rule of thumb, it is desirable to enable garbage collection when reading large spreadsheets from a batch process or from the command line, but better to deactivate the feature when reading large spreadsheets within a WAS, as the calls to System.gc() not only garbage collect the junk in JExcelApi, but also in the webservers JVM and can cause significant slowdown GC deactivated using -Djxl.nogc=true on the JVM command line Activated by default or by using -Djxl.nogc=false on the JVM command line

locale

private java.util.Locale locale
The locale. Normally this is the same as the system locale, but there may be cases (eg. where you are uploading many spreadsheets from foreign sources) where you may want to specify the locale on an individual worksheet basis The locale may also be specified on the command line using the lang and country System properties eg. -Djxl.lang=en -Djxl.country=UK for UK English

defaultInitialFileSize

private static final int defaultInitialFileSize

defaultArrayGrowSize

private static final int defaultArrayGrowSize
Constructor Detail

WorkbookSettings

public WorkbookSettings()
Default constructor
Method Detail

setArrayGrowSize

public void setArrayGrowSize(int sz)
Sets the amount of memory by which to increase the amount of memory allocated to storing the workbook data. For processeses reading many small workbooks inside a WAS it might be necessary to reduce the default size Default value is 1 megabyte
Parameters:
sz - the file size in bytes

getArrayGrowSize

public int getArrayGrowSize()
Accessor for the array grow size property
Returns:
the array grow size

setInitialFileSize

public void setInitialFileSize(int sz)
Sets the initial amount of memory allocated to store the workbook data when reading a worksheet. For processeses reading many small workbooks inside a WAS it might be necessary to reduce the default size Default value is 5 megabytes
Parameters:
sz - the file size in bytes

getInitialFileSize

public int getInitialFileSize()
Accessor for the initial file size property
Returns:
the initial file size

getChartsDisabled

public boolean getChartsDisabled()
Gets the charts disabled flag
Returns:
TRUE if charts are disabled, FALSE otherwise

getGCDisabled

public boolean getGCDisabled()
Accessor for the disabling of garbage collection
Returns:
FALSE if JExcelApi hints for garbage collection, TRUE otherwise

getNamesDisabled

public boolean getNamesDisabled()
Accessor for the disabling of interpretation of named ranges
Returns:
FALSE if named cells are interpreted, TRUE otherwise

setLocale

public void setLocale(java.util.Locale l)
Sets the locale for this spreadsheet
Parameters:
l - the locale

getLocale

public java.util.Locale getLocale()
Returns the locale used for the spreadsheet
Returns:
the locale