edu.neu.ccs.demeterf.util
Class Util

java.lang.Object
  extended by edu.neu.ccs.demeterf.util.Util

public class Util
extends java.lang.Object

Utility Class for globally useful methods


Field Summary
static boolean allowNull
          Allow null fields during traversal
static java.lang.Class<?>[] builtInArray
           
static java.util.HashSet<java.lang.Class<?>> builtIns
          List of Primitive Classes
static boolean skipPrivate
          Skip private fields during Traversal, this is set to true to be able to hide the library details, so we can use non Comparable types with an external Comparator
static boolean warningOn
          Show Method selection Warnings
 
Method Summary
static java.lang.Object[] addArg(java.lang.Object[] o, Option arg)
          Add the Argument (if there is one) to the end of the array
static void addBuiltIn(java.lang.Class<?> c)
          Add a Class to be considered a Primitive
static void addBuiltIns(java.lang.Class<?>... cs)
          Add a Number of Classes to be considered Primitives
static java.lang.Object applyFObj(java.lang.Object f, java.lang.Object[] o, MethodDB<java.lang.reflect.Method> db, java.lang.String meth, int def)
          Generic function object application (Faster)
static java.lang.Class<?> box(java.lang.Class<?> c)
          For predicting Box/Unboxing and the associated Type differences
static java.lang.String capCase(java.lang.String s)
          Return the given string with a capitalized first character
static java.lang.Class<?>[] classesFromObjects(java.lang.Object[] o, int len)
          Class Array from an Object Array [Map :)]
static List<java.lang.reflect.Field> getFuncFields(java.lang.Class<?> c)
          Get all the Fields of a given Class (transitive)
static void nullError()
          Throw a Traversal Error for a Null Object
static void nullFieldError(java.lang.reflect.Field f)
          Throw a Traversal Error for a Null Field
static java.lang.Object[] objectSubset(java.lang.Object[] o, int len)
          Object Array from another Object Array
static void print(java.lang.String s)
          Shorter than System.out...
static void println(java.lang.String s)
          Shorter than System.out...
static boolean setAllowNull(boolean b)
          Turn support for null fields on/off
static boolean setDebug(boolean b)
          Turn Traversal debugging output on/off
static boolean setSkipPrivate(boolean b)
          Skip Private Fields
static boolean setWarning(boolean b)
          Turn Traversal warning output on/off
static java.lang.String signature(java.lang.Class<?> c, java.lang.String name, java.lang.Class<?>[] cs, int max)
          Signature Printing Helper
static java.lang.String signature(java.lang.Class<?> c, java.lang.String name, java.lang.Object[] o, int max)
          Signature Printing Helper
static java.lang.String signature(java.lang.Class<?> c, java.lang.String name, java.lang.String[] cs, int max)
          Signature Printing Helper
static java.lang.String signature(java.lang.reflect.Constructor<?> c)
          Signature Printing Helper
static java.lang.String signature(java.lang.reflect.Method m)
          Signature Printing Helper
static java.lang.Class<?> unbox(java.lang.Class<?> c)
          For predicting Box/Unboxing and the associated Type differences
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

warningOn

public static boolean warningOn
Show Method selection Warnings


allowNull

public static boolean allowNull
Allow null fields during traversal


skipPrivate

public static boolean skipPrivate
Skip private fields during Traversal, this is set to true to be able to hide the library details, so we can use non Comparable types with an external Comparator


builtIns

public static java.util.HashSet<java.lang.Class<?>> builtIns
List of Primitive Classes


builtInArray

public static java.lang.Class<?>[] builtInArray
Method Detail

setDebug

public static boolean setDebug(boolean b)
Turn Traversal debugging output on/off


setWarning

public static boolean setWarning(boolean b)
Turn Traversal warning output on/off


setAllowNull

public static boolean setAllowNull(boolean b)
Turn support for null fields on/off


setSkipPrivate

public static boolean setSkipPrivate(boolean b)
Skip Private Fields


print

public static void print(java.lang.String s)
Shorter than System.out...


println

public static void println(java.lang.String s)
Shorter than System.out...


addBuiltIn

public static void addBuiltIn(java.lang.Class<?> c)
Add a Class to be considered a Primitive


addBuiltIns

public static void addBuiltIns(java.lang.Class<?>... cs)
Add a Number of Classes to be considered Primitives


getFuncFields

public static List<java.lang.reflect.Field> getFuncFields(java.lang.Class<?> c)
Get all the Fields of a given Class (transitive)


addArg

public static java.lang.Object[] addArg(java.lang.Object[] o,
                                        Option arg)
Add the Argument (if there is one) to the end of the array


applyFObj

public static java.lang.Object applyFObj(java.lang.Object f,
                                         java.lang.Object[] o,
                                         MethodDB<java.lang.reflect.Method> db,
                                         java.lang.String meth,
                                         int def)
Generic function object application (Faster)


classesFromObjects

public static java.lang.Class<?>[] classesFromObjects(java.lang.Object[] o,
                                                      int len)
Class Array from an Object Array [Map :)]


objectSubset

public static java.lang.Object[] objectSubset(java.lang.Object[] o,
                                              int len)
Object Array from another Object Array


signature

public static java.lang.String signature(java.lang.reflect.Method m)
Signature Printing Helper


signature

public static java.lang.String signature(java.lang.reflect.Constructor<?> c)
Signature Printing Helper


signature

public static java.lang.String signature(java.lang.Class<?> c,
                                         java.lang.String name,
                                         java.lang.Object[] o,
                                         int max)
Signature Printing Helper


signature

public static java.lang.String signature(java.lang.Class<?> c,
                                         java.lang.String name,
                                         java.lang.Class<?>[] cs,
                                         int max)
Signature Printing Helper


signature

public static java.lang.String signature(java.lang.Class<?> c,
                                         java.lang.String name,
                                         java.lang.String[] cs,
                                         int max)
Signature Printing Helper


nullError

public static void nullError()
Throw a Traversal Error for a Null Object


nullFieldError

public static void nullFieldError(java.lang.reflect.Field f)
Throw a Traversal Error for a Null Field


box

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


unbox

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


capCase

public static java.lang.String capCase(java.lang.String s)
Return the given string with a capitalized first character