Package mondrian.util
Class UtilCompatibleJdk15
- java.lang.Object
-
- mondrian.util.UtilCompatibleJdk15
-
- All Implemented Interfaces:
UtilCompatible
- Direct Known Subclasses:
UtilCompatibleJdk16
public class UtilCompatibleJdk15 extends Object implements UtilCompatible
Implementation ofUtilCompatiblewhich 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 inUtil, and not instantiate it at all.- Since:
- Feb 5, 2007
- Author:
- jhyde
-
-
Constructor Summary
Constructors Constructor Description UtilCompatibleJdk15()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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.StringgenerateUuidString()<T> TgetAnnotation(Method method, String annotationClassName, T defaultValue)Util.MemoryInfogetMemoryInfo()Creates an object from which to get information about system memory use.BigDecimalmakeBigDecimalFromDouble(double d)This generates a BigDecimal with a precision reflecting the precision of the input double.<T> Set<T>newIdentityHashSet()Creates a hash set that, likeIdentityHashMap, compares keys using identity.TimernewTimer(String name, boolean isDaemon)Equivalent toTimer(String, boolean).StringquotePattern(String s)<T> voidthreadLocalRemove(ThreadLocal<T> threadLocal)Removes a thread local from the current thread.
-
-
-
Method Detail
-
makeBigDecimalFromDouble
public BigDecimal makeBigDecimalFromDouble(double d)
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
public String quotePattern(String s)
- Specified by:
quotePatternin interfaceUtilCompatible
-
getAnnotation
public <T> T getAnnotation(Method method, String annotationClassName, T defaultValue)
- Specified by:
getAnnotationin interfaceUtilCompatible
-
generateUuidString
public String generateUuidString()
- Specified by:
generateUuidStringin interfaceUtilCompatible
-
compileScript
public <T> T compileScript(Class<T> iface, String script, String engineName)
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
public <T> void threadLocalRemove(ThreadLocal<T> threadLocal)
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
public Util.MemoryInfo 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
public Timer newTimer(String name, boolean isDaemon)
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
public void cancelStatement(Statement stmt)
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
public <T> Set<T> 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
public <T extends Comparable<T>> int binarySearch(T[] ts, int start, int end, T t)
Description copied from interface:UtilCompatibleAsArrays.binarySearch(Object[], int, int, Object), but available pre-JDK 1.6.- Specified by:
binarySearchin interfaceUtilCompatible
-
-