public interface UtilCompatible
The methods should not be called directly, only via the corresponding
static methods in Util
, namely:
This interface could in principle be extended to allow native implementations of methods, or to serve as a factory for entire classes which have different implementations in different environments.
Modifier and Type | Method and Description |
---|---|
<T extends Comparable<T>> |
binarySearch(T[] ts,
int start,
int end,
T t)
As
Arrays.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.
|
String |
generateUuidString() |
<T> T |
getAnnotation(Method method,
String annotationClassName,
T defaultValue) |
Util.MemoryInfo |
getMemoryInfo()
Creates an object from which to get information about system memory
use.
|
BigDecimal |
makeBigDecimalFromDouble(double d) |
<T> Set<T> |
newIdentityHashSet()
Creates a hash set that, like
IdentityHashMap ,
compares keys using identity. |
Timer |
newTimer(String name,
boolean isDaemon)
Equivalent to
Timer.Timer(String, boolean) . |
String |
quotePattern(String s) |
<T> void |
threadLocalRemove(ThreadLocal<T> threadLocal)
Removes a thread local from the current thread.
|
BigDecimal makeBigDecimalFromDouble(double d)
String generateUuidString()
void cancelStatement(Statement stmt)
Util
.stmt
- The statement to close.<T> T compileScript(Class<T> iface, String script, String engineName)
T
- Interfaceiface
- Interface script should implementscript
- Script codeengineName
- Name of engine (e.g. "JavaScript")<T> void threadLocalRemove(ThreadLocal<T> threadLocal)
From JDK 1.5 onwards, calls ThreadLocal.remove()
; before
that, no-ops.
T
- TypethreadLocal
- Thread local<T> Set<T> newIdentityHashSet()
IdentityHashMap
,
compares keys using identity.T
- Element type<T extends Comparable<T>> int binarySearch(T[] ts, int start, int end, T t)
Arrays.binarySearch(Object[], int, int, Object)
, but
available pre-JDK 1.6.Util.MemoryInfo getMemoryInfo()
MemoryPoolMXBean
.Timer newTimer(String name, boolean isDaemon)
Timer.Timer(String, boolean)
.
(Introduced in JDK 1.5.)name
- the name of the associated threadisDaemon
- true if the associated thread should run as a daemonCopyright © 2019 Hitachi Vantara. All rights reserved.