java.lang.Object
de.grogra.util.Utils
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean[]
static final byte[]
static final char[]
static PrintWriter
static final int
static final double[]
static final float[]
static final I18NBundle
static final int[]
static final long[]
static final Object[]
static final short[]
static final String[]
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static int
decodeBase64
(CharSequence in, int offset, int len, byte[] out) static Object
decodeBase64
(CharSequence in, int offset, int len, TypeLoader loader) static void
static void
static void
encodeBase64
(byte[] buf, int off, int len, StringBuffer out) static void
encodeBase64
(Object object, StringBuffer out) static boolean
static String
escape
(CharSequence s, String special) static void
escapeForXML
(StringBuffer b, int start) static void
escapeForXML
(StringBuffer b, int start, int end) static final String
static Object
evaluate
(String clsAndMember, Object[] args, ClassLoader loader) static int
executeForcedlyAndUninterruptibly
(Lockable resource, LockProtectedRunnable task, boolean write) static int
executeForcedlyAndUninterruptibly
(Lockable resource, LockProtectedRunnable task, Lock retained) static URL
static String
static void
flushHandlers
(Logger logger) static void
formatDateAndName
(LogRecord log, StringBuffer buffer) static String
formatMessage
(String message, int width) Wrap a String msg into an html message with the given width.static int
fromHexDigit
(int c) static Object
get
(I18NBundle bundle, String key, String type, Object defaultDescription) static Object
static Color
getApproximateColor
(int rgb) static boolean
getBoolean
(Map a, Object key) static boolean
getBoolean
(Map a, Object key, boolean defaultValue) static byte
static byte
static char
static char
static String
getDisplayLoggerName
(String logger) static double
static double
static float
static float
static int
static int
static long
static long
static Throwable
static Object
static Object
static short
static short
static String
static InputStream
getStreamResource
(String url) static int
static int
getStringHashCode
(CharSequence c, int begin, int end) static URL
getURLResource
(String url) static Throwable
static int
static boolean
static int
indexOfOne
(int i) static Throwable
static Object
invoke
(String clsAndMethod, Object[] args, ClassLoader loader) static Object
invokeStatic
(Class cls, String method, Object[] args) static Object
invokeStatic
(String cls, String method, Object[] args, ClassLoader loader) static Object
invokeVirtual
(Object instance, String method, Object[] args) static boolean
isContained
(Object value, Object[] array) static boolean
isStringDescription
(String type) static boolean
static long
nanoTime()
static Object
newInstance
(Class cls, Object[] args) static Object
newInstance
(String cls, Object[] args, ClassLoader loader) static SAXException
newSAXException
(Exception cause) static Color
parseColor
(String s) static Dimension
static int
parseFloatArray
(String s, float[] a, String delim) static Point
parsePoint
(String s) static Rectangle
static Object[]
static Object[]
pathToArray
(Path p) Turn a Path into an array (/path1/dir2/file.txt) > [path1, dir2, file.txt] path1, dir2, file.txt being stringsstatic void
static String
static void
quote
(CharSequence s, StringBuffer out) static void
read
(Reader in, StringBuffer out) static void
readFully
(InputStream in, byte[] buf) static void
readFully
(InputStream in, byte[] buf, int off, int len) static File
relativize
(File base, File f) static void
static File
static void
static void
setDisplayLoggerName
(String logger, String name) static char
toHexDigit
(int digit, boolean upperCase) static String
static String
unquote
(CharSequence s, int start, int end, int[] endOut) static Throwable
static Throwable
static File
static void
-
Field Details
-
DEBUG
public static final int DEBUG- See Also:
-
I18N
-
BOOLEAN_0
public static final boolean[] BOOLEAN_0 -
BYTE_0
public static final byte[] BYTE_0 -
SHORT_0
public static final short[] SHORT_0 -
CHAR_0
public static final char[] CHAR_0 -
INT_0
public static final int[] INT_0 -
LONG_0
public static final long[] LONG_0 -
FLOAT_0
public static final float[] FLOAT_0 -
DOUBLE_0
public static final double[] DOUBLE_0 -
OBJECT_0
-
STRING_0
-
debug
-
-
Method Details
-
nanoTime
public static long nanoTime() -
hasNanoTimeMethod
public static boolean hasNanoTimeMethod() -
getApproximateColor
-
indexOfOne
public static int indexOfOne(int i) -
getURLResource
-
getStreamResource
-
get
-
getBoolean
-
getBoolean
-
getByte
-
getByte
-
getShort
-
getShort
-
getChar
-
getChar
-
getInt
-
getInt
-
getLong
-
getLong
-
getFloat
-
getFloat
-
getDouble
-
getDouble
-
getObject
-
getObject
-
firstToUpperCase
-
equal
-
contentEquals
-
getStringHashCode
-
getStringHashCode
-
getUserException
-
unwrap
-
unwrapFully
-
getMainException
-
initCauses
-
getStackTrace
-
evaluate
public static Object evaluate(String clsAndMember, Object[] args, ClassLoader loader) throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException, InstantiationException, IllegalAccessException, InvocationTargetException -
invoke
public static Object invoke(String clsAndMethod, Object[] args, ClassLoader loader) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException -
invokeStatic
public static Object invokeStatic(String cls, String method, Object[] args, ClassLoader loader) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException -
invokeStatic
public static Object invokeStatic(Class cls, String method, Object[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
invokeVirtual
public static Object invokeVirtual(Object instance, String method, Object[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
newInstance
public static Object newInstance(String cls, Object[] args, ClassLoader loader) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException -
newInstance
public static Object newInstance(Class cls, Object[] args) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException -
newSAXException
-
rethrow
-
dumpArray
-
isContained
-
hashCode
-
dumpTree
-
escape
-
escapeForXML
-
escapeForXML
-
pathToArray
Turn a Path into an array (/path1/dir2/file.txt) > [path1, dir2, file.txt] path1, dir2, file.txt being strings -
pathToArray
-
relativize
-
resolve
-
isURL
-
fileToURL
-
urlToFile
-
quote
-
quote
-
unquote
-
unquote
-
parseDimension
-
parsePoint
-
parseColor
-
parseRectangle
-
parseFloatArray
-
watchShutdown
public static void watchShutdown() -
isStringDescription
-
get
-
encodeBase64
-
decodeBase64
- Throws:
IOException
-
encodeBase64
- Throws:
IOException
-
decodeBase64
public static Object decodeBase64(CharSequence in, int offset, int len, TypeLoader loader) throws IOException, ClassNotFoundException - Throws:
IOException
ClassNotFoundException
-
readFully
- Throws:
IOException
-
readFully
- Throws:
IOException
-
read
- Throws:
IOException
-
eval
-
toHexDigit
public static char toHexDigit(int digit, boolean upperCase) -
fromHexDigit
public static int fromHexDigit(int c) -
resetTime
public static void resetTime() -
printTime
-
flushHandlers
-
formatMessage
Wrap a String msg into an html message with the given width. Ease the- Parameters:
message
-width
-- Returns:
-
getDisplayLoggerName
-
setDisplayLoggerName
-
formatDateAndName
-
executeForcedlyAndUninterruptibly
public static int executeForcedlyAndUninterruptibly(Lockable resource, LockProtectedRunnable task, boolean write) -
executeForcedlyAndUninterruptibly
public static int executeForcedlyAndUninterruptibly(Lockable resource, LockProtectedRunnable task, Lock retained)
-