util
Class Util

java.lang.Object
  extended by util.Util

public class Util
extends java.lang.Object

Wrapper class for various helper methods.


Field Summary
static java.lang.String funcObjMethName
          Name of Handler Methods
static java.util.HashMap<java.lang.Class<?>,java.lang.Class<?>> unboxed
          Unboxed -> Boxed primitive types
 
Constructor Summary
Util()
           
 
Method Summary
static java.lang.RuntimeException addTop(java.lang.RuntimeException rte, java.lang.StackTraceElement top)
          Add an element to the top of a StackTrace, also used to hide implementation details
static java.lang.Object applyFunc(java.lang.Object f, java.lang.reflect.Method m, java.lang.Object[] args)
          Apply the given method using the given Object and arguments
static java.lang.String argsString(java.lang.Class<?>[] args, int i)
          Return a pretty argument string for displaying signatures
static java.lang.Class<?> box(java.lang.Class<?> c)
          For predicting Box/Unboxing and the associated Type differences/subtyping
static java.lang.String display(java.lang.Object o)
          Return a String representation of the given arbitrary Object
static java.lang.String display(java.lang.Object o, java.lang.Class<?> c, java.lang.String idt)
          Return a String representation of the given Object of the given Class
static java.lang.String display(java.lang.Object o, java.lang.String idt)
          Return a String representation of the given arbitrary Object
static java.lang.String escape(char c)
          Return a String for a single expanded/escaped character
static java.lang.RuntimeException exceptionDrop(int n, java.lang.String msg)
          Return an exception, but drop the top N frames (to hide implementation details)
static java.lang.reflect.Field[] fields(java.lang.Class<?> c)
          Retrieve the (transitive) fields of the given class
static void main(java.lang.String[] args)
          Simple Test for SExp output
static java.lang.String repeat(char c, int times)
          Repeat a character a bunch of times
static boolean subtype(java.lang.Class<?> a, java.lang.Class<?> b)
          Subtype comparison
static boolean subtypes(java.lang.Class<?>[] a, java.lang.Class<?>[] b)
          Array Subtype comparison
static java.lang.String toSExp(java.lang.Object o)
          Return a String representing an SExp of the given arbitrary Object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

funcObjMethName

public static java.lang.String funcObjMethName
Name of Handler Methods


unboxed

public static java.util.HashMap<java.lang.Class<?>,java.lang.Class<?>> unboxed
Unboxed -> Boxed primitive types

Constructor Detail

Util

public Util()
Method Detail

main

public static void main(java.lang.String[] args)
Simple Test for SExp output


argsString

public static java.lang.String argsString(java.lang.Class<?>[] args,
                                          int i)
Return a pretty argument string for displaying signatures


box

public static java.lang.Class<?> box(java.lang.Class<?> c)
For predicting Box/Unboxing and the associated Type differences/subtyping


subtype

public static boolean subtype(java.lang.Class<?> a,
                              java.lang.Class<?> b)
Subtype comparison


subtypes

public static boolean subtypes(java.lang.Class<?>[] a,
                               java.lang.Class<?>[] b)
Array Subtype comparison


applyFunc

public static java.lang.Object applyFunc(java.lang.Object f,
                                         java.lang.reflect.Method m,
                                         java.lang.Object[] args)
Apply the given method using the given Object and arguments


exceptionDrop

public static java.lang.RuntimeException exceptionDrop(int n,
                                                       java.lang.String msg)
Return an exception, but drop the top N frames (to hide implementation details)


addTop

public static java.lang.RuntimeException addTop(java.lang.RuntimeException rte,
                                                java.lang.StackTraceElement top)
Add an element to the top of a StackTrace, also used to hide implementation details


display

public static java.lang.String display(java.lang.Object o)
Return a String representation of the given arbitrary Object


display

public static java.lang.String display(java.lang.Object o,
                                       java.lang.String idt)
Return a String representation of the given arbitrary Object


display

public static java.lang.String display(java.lang.Object o,
                                       java.lang.Class<?> c,
                                       java.lang.String idt)
Return a String representation of the given Object of the given Class


repeat

public static java.lang.String repeat(char c,
                                      int times)
Repeat a character a bunch of times


escape

public static java.lang.String escape(char c)
Return a String for a single expanded/escaped character


fields

public static java.lang.reflect.Field[] fields(java.lang.Class<?> c)
Retrieve the (transitive) fields of the given class


toSExp

public static java.lang.String toSExp(java.lang.Object o)
Return a String representing an SExp of the given arbitrary Object