java.lang.Object
de.grogra.util.Utils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean[]static final byte[]static final char[]static PrintWriterstatic final intstatic final double[]static final float[]static final I18NBundlestatic final int[]static final long[]static final Object[]static final short[]static final String[] -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic intdecodeBase64(CharSequence in, int offset, int len, byte[] out) static ObjectdecodeBase64(CharSequence in, int offset, int len, TypeLoader loader) static voidstatic voidstatic voidencodeBase64(byte[] buf, int off, int len, StringBuffer out) static voidencodeBase64(Object object, StringBuffer out) static booleanstatic Stringescape(CharSequence s, String special) static voidescapeForXML(StringBuffer b, int start) static voidescapeForXML(StringBuffer b, int start, int end) static final Stringstatic Objectevaluate(String clsAndMember, Object[] args, ClassLoader loader) static intexecuteForcedlyAndUninterruptibly(Lockable resource, LockProtectedRunnable task, boolean write) static intexecuteForcedlyAndUninterruptibly(Lockable resource, LockProtectedRunnable task, Lock retained) static URLstatic Stringstatic voidflushHandlers(Logger logger) static voidformatDateAndName(LogRecord log, StringBuffer buffer) static StringformatMessage(String message, int width) Wrap a String msg into an html message with the given width.static intfromHexDigit(int c) static Objectget(I18NBundle bundle, String key, String type, Object defaultDescription) static Objectstatic ColorgetApproximateColor(int rgb) static booleangetBoolean(Map a, Object key) static booleangetBoolean(Map a, Object key, boolean defaultValue) static bytestatic bytestatic charstatic charstatic StringgetDisplayLoggerName(String logger) static doublestatic doublestatic floatstatic floatstatic intstatic intstatic longstatic longstatic Throwablestatic Objectstatic Objectstatic shortstatic shortstatic Stringstatic InputStreamgetStreamResource(String url) static intstatic intgetStringHashCode(CharSequence c, int begin, int end) static URLgetURLResource(String url) static Throwablestatic intstatic booleanstatic intindexOfOne(int i) static Throwablestatic Objectinvoke(String clsAndMethod, Object[] args, ClassLoader loader) static ObjectinvokeStatic(Class cls, String method, Object[] args) static ObjectinvokeStatic(String cls, String method, Object[] args, ClassLoader loader) static ObjectinvokeVirtual(Object instance, String method, Object[] args) static booleanisContained(Object value, Object[] array) static booleanisStringDescription(String type) static booleanstatic longnanoTime()static ObjectnewInstance(Class cls, Object[] args) static ObjectnewInstance(String cls, Object[] args, ClassLoader loader) static SAXExceptionnewSAXException(Exception cause) static ColorparseColor(String s) static Dimensionstatic intparseFloatArray(String s, float[] a, String delim) static PointparsePoint(String s) static Rectanglestatic 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 voidstatic Stringstatic voidquote(CharSequence s, StringBuffer out) static voidread(Reader in, StringBuffer out) static voidreadFully(InputStream in, byte[] buf) static voidreadFully(InputStream in, byte[] buf, int off, int len) static Filerelativize(File base, File f) static voidstatic Filestatic voidstatic voidsetDisplayLoggerName(String logger, String name) static chartoHexDigit(int digit, boolean upperCase) static Stringstatic Stringunquote(CharSequence s, int start, int end, int[] endOut) static Throwablestatic Throwablestatic Filestatic 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:
IOExceptionClassNotFoundException
-
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)
-