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
Constructors -
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.voidcancelStatement(Statement stmt) Cancels and closes a SQL Statement object.<T> TcompileScript(Class<T> iface, String script, String engineName) Compiles a script to yield a Java interface.<T> TgetAnnotation(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> voidthreadLocalRemove(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:
makeBigDecimalFromDoublein interfaceUtilCompatible- Parameters:
d- input double- Returns:
- BigDecimal
-
quotePattern
- Specified by:
quotePatternin interfaceUtilCompatible
-
getAnnotation
- Specified by:
getAnnotationin interfaceUtilCompatible
-
generateUuidString
- Specified by:
generateUuidStringin interfaceUtilCompatible
-
compileScript
Description copied from interface:UtilCompatibleCompiles a script to yield a Java interface.- Specified by:
compileScriptin 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:UtilCompatibleRemoves a thread local from the current thread.From JDK 1.5 onwards, calls
ThreadLocal.remove(); before that, no-ops.- Specified by:
threadLocalRemovein interfaceUtilCompatible- Type Parameters:
T- Type- Parameters:
threadLocal- Thread local
-
getMemoryInfo
Description copied from interface:UtilCompatibleCreates an object from which to get information about system memory use. From JDK 1.5 onwards, usesMemoryPoolMXBean.- Specified by:
getMemoryInfoin interfaceUtilCompatible- Returns:
- Memory info
-
newTimer
Description copied from interface:UtilCompatibleEquivalent toTimer(String, boolean). (Introduced in JDK 1.5.)- Specified by:
newTimerin 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:UtilCompatibleCancels and closes a SQL Statement object. If errors are encountered, they should be logged underUtil.- Specified by:
cancelStatementin interfaceUtilCompatible- Parameters:
stmt- The statement to close.
-
newIdentityHashSet
Description copied from interface:UtilCompatibleCreates a hash set that, likeIdentityHashMap, compares keys using identity.- Specified by:
newIdentityHashSetin interfaceUtilCompatible- Type Parameters:
T- Element type- Returns:
- Set
-
binarySearch
Description copied from interface:UtilCompatibleAsArrays.binarySearch(Object[], int, int, Object), but available pre-JDK 1.6.- Specified by:
binarySearchin interfaceUtilCompatible
-