Package mondrian.util
Class UtilCompatibleJdk15
java.lang.Object
mondrian.util.UtilCompatibleJdk15
- All Implemented Interfaces:
UtilCompatible
- Direct Known Subclasses:
UtilCompatibleJdk16
Implementation of
UtilCompatible
which runs in
JDK 1.5.
Prior to JDK 1.5, this class should never be loaded. Applications should
instantiate this class via Class.forName(String)
or better, use
methods in Util
, and not instantiate it at all.
- Since:
- Feb 5, 2007
- Author:
- jhyde
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Comparable<T>>
intbinarySearch
(T[] ts, int start, int end, T t) AsArrays.binarySearch(Object[], int, int, Object)
, but available pre-JDK 1.6.void
cancelStatement
(Statement stmt) Cancels and closes a SQL Statement object.<T> T
compileScript
(Class<T> iface, String script, String engineName) Compiles a script to yield a Java interface.<T> T
getAnnotation
(Method method, String annotationClassName, T defaultValue) Creates an object from which to get information about system memory use.makeBigDecimalFromDouble
(double d) This generates a BigDecimal with a precision reflecting the precision of the input double.<T> Set<T>
Creates a hash set that, likeIdentityHashMap
, compares keys using identity.Equivalent toTimer(String, boolean)
.<T> void
threadLocalRemove
(ThreadLocal<T> threadLocal) Removes a thread local from the current thread.
-
Constructor Details
-
UtilCompatibleJdk15
public UtilCompatibleJdk15()
-
-
Method Details
-
makeBigDecimalFromDouble
This generates a BigDecimal with a precision reflecting the precision of the input double.- Specified by:
makeBigDecimalFromDouble
in interfaceUtilCompatible
- Parameters:
d
- input double- Returns:
- BigDecimal
-
quotePattern
- Specified by:
quotePattern
in interfaceUtilCompatible
-
getAnnotation
- Specified by:
getAnnotation
in interfaceUtilCompatible
-
generateUuidString
- Specified by:
generateUuidString
in interfaceUtilCompatible
-
compileScript
Description copied from interface:UtilCompatible
Compiles a script to yield a Java interface.- Specified by:
compileScript
in interfaceUtilCompatible
- Type Parameters:
T
- Interface- Parameters:
iface
- Interface script should implementscript
- Script codeengineName
- Name of engine (e.g. "JavaScript")- Returns:
- Object that implements given interface
-
threadLocalRemove
Description copied from interface:UtilCompatible
Removes a thread local from the current thread.From JDK 1.5 onwards, calls
ThreadLocal.remove()
; before that, no-ops.- Specified by:
threadLocalRemove
in interfaceUtilCompatible
- Type Parameters:
T
- Type- Parameters:
threadLocal
- Thread local
-
getMemoryInfo
Description copied from interface:UtilCompatible
Creates an object from which to get information about system memory use. From JDK 1.5 onwards, usesMemoryPoolMXBean
.- Specified by:
getMemoryInfo
in interfaceUtilCompatible
- Returns:
- Memory info
-
newTimer
Description copied from interface:UtilCompatible
Equivalent toTimer(String, boolean)
. (Introduced in JDK 1.5.)- Specified by:
newTimer
in interfaceUtilCompatible
- Parameters:
name
- the name of the associated threadisDaemon
- true if the associated thread should run as a daemon- Returns:
- timer
-
cancelStatement
Description copied from interface:UtilCompatible
Cancels and closes a SQL Statement object. If errors are encountered, they should be logged underUtil
.- Specified by:
cancelStatement
in interfaceUtilCompatible
- Parameters:
stmt
- The statement to close.
-
newIdentityHashSet
Description copied from interface:UtilCompatible
Creates a hash set that, likeIdentityHashMap
, compares keys using identity.- Specified by:
newIdentityHashSet
in interfaceUtilCompatible
- Type Parameters:
T
- Element type- Returns:
- Set
-
binarySearch
Description copied from interface:UtilCompatible
AsArrays.binarySearch(Object[], int, int, Object)
, but available pre-JDK 1.6.- Specified by:
binarySearch
in interfaceUtilCompatible
-