org.erif.util
Class JavaUtil

java.lang.Object
  |
  +--org.erif.util.JavaUtil

public class JavaUtil
extends java.lang.Object

mostly for conveniently parsing an exception as a String


Constructor Summary
JavaUtil()
           
 
Method Summary
static java.util.Vector arrayToVector(java.lang.Object[] array)
          Creates a new Vector with the contents of the Object array.
static java.lang.String byteArrayToHex(byte[] bs)
           
static java.lang.String byteToHex(byte b)
           
static char digitToHex(int i)
           
static java.lang.String exceptionToString(java.lang.Throwable e)
           
static long[] getLongIdentifiers(java.util.Iterator array, java.lang.Class c, java.lang.String methodname)
          builds a array of longs from an array of objects extracting via parameterless method.
static java.util.Hashtable hash(java.util.Iterator array, java.lang.Class c, java.lang.String methodname)
          builds a hash from an array of objects keying to the given method.
static java.util.Hashtable hash(java.util.Iterator array, java.lang.Class c, java.lang.String keymethodname, java.lang.String valuemethodname)
          builds a hash from an array of objects keying one method to the values of another.
static java.util.Hashtable invertHashtable(java.util.Hashtable orig)
          returns a hashtable that has as its keys the values of the old table.
static byte[] readBytes(java.io.File f)
           
static java.lang.Object[] straighten(java.lang.Object[][] o)
          straighten an Object[][] into an Object[], essentially concatenating each following piece
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaUtil

public JavaUtil()
Method Detail

readBytes

public static byte[] readBytes(java.io.File f)
                        throws java.io.IOException

byteArrayToHex

public static java.lang.String byteArrayToHex(byte[] bs)

byteToHex

public static java.lang.String byteToHex(byte b)

digitToHex

public static char digitToHex(int i)

exceptionToString

public static java.lang.String exceptionToString(java.lang.Throwable e)

arrayToVector

public static java.util.Vector arrayToVector(java.lang.Object[] array)
Creates a new Vector with the contents of the Object array.
Parameters:
array - Objects to add to aray
Returns:
New array

invertHashtable

public static java.util.Hashtable invertHashtable(java.util.Hashtable orig)
returns a hashtable that has as its keys the values of the old table. if things are not unique it barfs.

hash

public static java.util.Hashtable hash(java.util.Iterator array,
                                       java.lang.Class c,
                                       java.lang.String methodname)
                                throws java.lang.NoSuchMethodException
builds a hash from an array of objects keying to the given method. if array is not unique it barfs. To get an Iterator from an Array, try Arrays.asList(Object[]).iterator().

hash

public static java.util.Hashtable hash(java.util.Iterator array,
                                       java.lang.Class c,
                                       java.lang.String keymethodname,
                                       java.lang.String valuemethodname)
                                throws java.lang.NoSuchMethodException
builds a hash from an array of objects keying one method to the values of another. if array is not unique it barfs.To get an Iterator from an Array, try Arrays.asList(Object[]).iterator().

getLongIdentifiers

public static long[] getLongIdentifiers(java.util.Iterator array,
                                        java.lang.Class c,
                                        java.lang.String methodname)
                                 throws java.lang.NoSuchMethodException
builds a array of longs from an array of objects extracting via parameterless method. To get an Iterator from an Array, try Arrays.asList(Object[]).iterator().

straighten

public static java.lang.Object[] straighten(java.lang.Object[][] o)
straighten an Object[][] into an Object[], essentially concatenating each following piece


Copyright © 2003 - kaolin fire