org.embl.ebi.escience.scufl.tools
Class Lang

java.lang.Object
  extended by org.embl.ebi.escience.scufl.tools.Lang

public class Lang
extends java.lang.Object

Extensions that try to make Java a better or easier programming language

Author:
Stian Soiland

Constructor Summary
Lang()
           
 
Method Summary
static java.lang.Object asObject(boolean b)
          Convert primitive type to the proper Object instance.
static java.lang.Object asObject(byte b)
           
static java.lang.Object asObject(char c)
           
static java.lang.Object asObject(double d)
           
static java.lang.Object asObject(float f)
           
static java.lang.Object asObject(int i)
           
static java.lang.Object asObject(long l)
           
static java.lang.Object asObject(short s)
           
static java.util.List asObjectList(java.lang.Object list)
          Convert arrays containing primitive types such as int[] into a List containing the Object version of the primitive type.
static java.lang.reflect.Method getMethod(java.lang.String method_name, java.lang.Object obj)
           
static java.util.List map(java.lang.reflect.Method method, java.util.Collection iterable, java.lang.Object obj)
           
static java.util.List map(java.lang.String method_name, java.util.Collection iterable, java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lang

public Lang()
Method Detail

getMethod

public static java.lang.reflect.Method getMethod(java.lang.String method_name,
                                                 java.lang.Object obj)

map

public static java.util.List map(java.lang.String method_name,
                                 java.util.Collection iterable,
                                 java.lang.Object obj)

map

public static java.util.List map(java.lang.reflect.Method method,
                                 java.util.Collection iterable,
                                 java.lang.Object obj)

asObject

public static java.lang.Object asObject(boolean b)
Convert primitive type to the proper Object instance.


asObject

public static java.lang.Object asObject(byte b)

asObject

public static java.lang.Object asObject(char c)

asObject

public static java.lang.Object asObject(double d)

asObject

public static java.lang.Object asObject(float f)

asObject

public static java.lang.Object asObject(int i)

asObject

public static java.lang.Object asObject(long l)

asObject

public static java.lang.Object asObject(short s)

asObjectList

public static java.util.List asObjectList(java.lang.Object list)
Convert arrays containing primitive types such as int[] into a List containing the Object version of the primitive type.

For instance, if the array is of type int[], the result will be a List containing Integer instances.

Deep arrays will also be converted, so a List containing String[] and char[] will be converted to a List containing another List of Strings and a List of Characters.

Parameters:
list - Array or List to be converted
Returns:
A List where arrays are converted to Lists and primitive types to their Object version.