Package opennlp.tools.util.normalizer
Class BundledUnicodeData.Lazy<T>
java.lang.Object
opennlp.tools.util.normalizer.BundledUnicodeData.Lazy<T>
- Type Parameters:
T- The type of the data.
- Enclosing class:
BundledUnicodeData
Holds data that is loaded on the first call to
get(). A load that throws is not
cached, so every call until one succeeds runs the loader and throws its exception.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
loader
-
value
-
-
Constructor Details
-
Lazy
Creates a holder that has not loaded yet.- Parameters:
loader- Loads the data. Must not benulland must not returnnull.- Throws:
IllegalArgumentException- Thrown ifloaderisnull.
-
-
Method Details
-
get
Returns the data, loading it on the first successful call.- Returns:
- The loaded data.
- Throws:
IllegalStateException- Thrown if the loader returnsnull.RuntimeException- Thrown as is if the loader fails; the next call loads again.
-