Class ZssContext

java.lang.Object
io.keikai.compat.ZssContext

public class ZssContext extends Object
Keikai Spreadsheet context for cell evaluation: Locale, two-digit year window, and circular-iteration limits.

This class previously lived at org.apache.poi.ss.usermodel.ZssContext as one of the 115 Potix custom modifications to the Apache POI fork. It was relocated here for Keikai 7.0 so the io.keikai:poi fork dependency can be dropped — see doc/upgrade-6.3-to-7.0.md.

Since:
7.0.0
Author:
henrichen@zkoss.org
  • Constructor Details

    • ZssContext

      public ZssContext(Locale locale, int twoDigitYearUpperBound)
    • ZssContext

      public ZssContext(Locale locale, int twoDigitYearUpperBound, double maxChange, int maxCount)
  • Method Details

    • 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(io.keikai.compat.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 Context defined by setThreadLocal(io.keikai.compat.ZssContext).
      See Also: