Package org.apache.poi.ss.usermodel
Class ZssContext
- java.lang.Object
-
- org.apache.poi.ss.usermodel.ZssContext
-
public class ZssContext extends Object
Keikai Spreadsheet context for cell evaluation, etc. for Locale and Two Digit Year interpretation.- Author:
- henrichen@zkoss.org
-
-
Constructor Summary
Constructors Constructor Description ZssContext(Locale locale, int twoDigitYearUpperBound)
ZssContext(Locale locale, int twoDigitYearUpperBound, double maxChange, int maxCount)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZssContext
getCurrent()
Returns the current Keikai Spreadsheet Context; never null.Locale
getLocale()
double
getMaxChange()
Returns the maximum changes between two circular evaluation.int
getMaxCount()
Returns the maximum iteration count on circular evaluation.static ZssContext
getThreadLocal()
Returns the Keikai Spreadsheet Contextdefined bysetThreadLocal(org.apache.poi.ss.usermodel.ZssContext)
.int
getTwoDigitYearUpperBound()
static ZssContext
setThreadLocal(ZssContext ctx)
Sets the locale for the current thread only.
-
-
-
Method Detail
-
getLocale
public Locale getLocale()
-
getTwoDigitYearUpperBound
public int getTwoDigitYearUpperBound()
-
getMaxCount
public int getMaxCount()
Returns the maximum iteration count on circular evaluation.- Returns:
-
getMaxChange
public double getMaxChange()
Returns the maximum changes between two circular evaluation.- Returns:
-
getCurrent
public static final ZssContext getCurrent()
Returns the current Keikai Spreadsheet Context; never null. This is the Keikai Spreadsheet Context that every other objects shall use, unless they have special consideration.Default: If
setThreadLocal(org.apache.poi.ss.usermodel.ZssContext)
was called with non-null, the value is returned. Otherwise, a default context is created and returned,
-
setThreadLocal
public static final ZssContext setThreadLocal(ZssContext ctx)
Sets the locale for the current thread only.Each thread could have an independent ZssContext, called the thread locale.
When Invoking this method under a thread that serves requests, remember to clean up the setting upon completing each request.
ZssContext old = ZssContext.setThreadLocal(newValue); try { ... } finally { ZssContext.setThreadLocal(old); }
- Parameters:
ctx
- the thread ZssContext; null to denote no thread zssContext- Returns:
- the previous thread locale
-
getThreadLocal
public static final ZssContext getThreadLocal()
Returns the Keikai Spreadsheet Contextdefined bysetThreadLocal(org.apache.poi.ss.usermodel.ZssContext)
.- See Also:
getCurrent()
-
-