|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsem.util.Tools
public class Tools
Collection of small useful functions.
| Constructor Summary | |
|---|---|
Tools()
|
|
| Method Summary | ||
|---|---|---|
static
|
_convert_to_ranks(java.util.HashMap<T,java.lang.Double> v)
|
|
static double |
gaussianPdf(double x)
Calculate the value based on the Gaussian probability density function. |
|
static double |
gaussianPdf(double x,
double mean,
double stddev)
Calculate the value based on the Gaussian probability density function. |
|
static double |
getDouble(java.lang.String text,
double def)
Get the double from text. |
|
static java.util.ArrayList<java.lang.String> |
getFileList(java.lang.String dir)
Get the list of files in a directory. |
|
static int |
getInt(java.lang.String text,
int def)
Get the integer from text. |
|
static boolean |
isBrack(java.lang.String string)
Check whether the string is a bracket. |
|
static boolean |
isEndBrack(java.lang.String string)
Check whether the string is an ending bracket. |
|
static boolean |
isFirstLetterCapitalized(java.lang.String string)
|
|
static boolean |
isInt(java.lang.String string)
Check whether the string is an integer. |
|
static boolean |
isStartBrack(java.lang.String string)
Check whether the string is a starting bracket. |
|
static java.lang.String |
join(java.util.List<java.lang.String> pieces,
java.lang.String delimiter)
Join a string using the delimiter. |
|
static java.lang.String |
join(java.lang.String[] pieces,
java.lang.String delimiter)
Join a string using the delimiter. |
|
static java.lang.Object |
load(java.lang.String file)
Load the serialised object from a file. |
|
static
|
pearson(java.util.HashMap<T,java.lang.Double> v1,
java.util.HashMap<T,java.lang.Double> v2)
Calculate Pearson's correlation coefficient. |
|
static void |
runCommand(java.lang.String command)
Run a system command. |
|
static void |
save(java.lang.Object obj,
java.lang.String file)
Serialise the object into a file. |
|
static
|
sort(java.util.HashMap<T,java.lang.Double> v,
boolean desc)
Sort a hashmap based on the values (descenging or ascending). |
|
static
|
spearman(java.util.HashMap<T,java.lang.Double> v1,
java.util.HashMap<T,java.lang.Double> v2)
Calculate Spearman's correlation coefficient. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Tools()
| Method Detail |
|---|
public static void runCommand(java.lang.String command)
command - public static boolean isInt(java.lang.String string)
string -
public static boolean isBrack(java.lang.String string)
string -
public static boolean isEndBrack(java.lang.String string)
string -
public static boolean isStartBrack(java.lang.String string)
string -
public static double gaussianPdf(double x)
x -
public static double gaussianPdf(double x,
double mean,
double stddev)
x -
public static boolean isFirstLetterCapitalized(java.lang.String string)
public static int getInt(java.lang.String text,
int def)
text - def -
public static double getDouble(java.lang.String text,
double def)
text - def -
public static java.util.ArrayList<java.lang.String> getFileList(java.lang.String dir)
dir -
public static void save(java.lang.Object obj,
java.lang.String file)
obj - file - public static java.lang.Object load(java.lang.String file)
file -
public static <T> double pearson(java.util.HashMap<T,java.lang.Double> v1,
java.util.HashMap<T,java.lang.Double> v2)
v1 - v2 -
public static <T> java.util.LinkedHashMap<T,java.lang.Double> sort(java.util.HashMap<T,java.lang.Double> v,
boolean desc)
v - desc -
public static <T> java.util.HashMap<T,java.lang.Double> _convert_to_ranks(java.util.HashMap<T,java.lang.Double> v)
public static <T> double spearman(java.util.HashMap<T,java.lang.Double> v1,
java.util.HashMap<T,java.lang.Double> v2)
v1 - v2 -
public static java.lang.String join(java.lang.String[] pieces,
java.lang.String delimiter)
pieces - delimiter -
public static java.lang.String join(java.util.List<java.lang.String> pieces,
java.lang.String delimiter)
pieces - delimiter -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||