|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.util.ToolBox
public class ToolBox
Several auxiliary static methods.
Constructor Summary | |
---|---|
ToolBox()
|
Method Summary | |
---|---|
static String |
col2string(Collection col,
int tab)
Multiline representation of a colection |
static void |
configureLogging()
Configurates log4j loging |
static String |
configureLogging(String logDir,
Properties properties)
Configurates log4j loging |
static String |
configureLogging(String logDir,
Properties properties,
boolean timeInFileName)
|
static String |
configureLogging(String logDir,
Properties properties,
boolean timeInFileName,
boolean includeSystemOuts)
Configurates log4j loging |
static String |
dict2string(Dictionary dict,
int tab)
Multiline representation of a dictionary |
static boolean |
equals(Object o1,
Object o2)
|
static Random |
getRandom()
Gets random number generator |
static long |
getSeed()
Gets current seed |
static Vector |
intersect(Collection source1,
Collection source2)
Returns intersection of two collections |
static DataProperties |
loadProperties(File propertyFile)
Loads data properties. |
static void |
merge(Vector target,
Collection source)
Merge source with target |
static double |
random()
Generates random double number |
static Object |
random(Collection set)
Returns random element from the given set of elements |
static int |
random(int limit)
Returns random number (int) from the set 0 .. limit - 1 |
static double |
rms(int n,
double x,
double x2)
Root mean square |
static void |
setSeed(long seed)
Sets seeds for getRandom() and random() methods. |
static Enumeration |
sortEnumeration(Enumeration e)
Sort enumeration |
static Enumeration |
sortEnumeration(Enumeration e,
Comparator c)
Sort enumeration |
static Collection |
subSet(Collection set,
double part)
Returns a randomly generated subset of the given set |
static Collection |
subSet(Collection set,
double part,
int minSize)
Returns a randomly generated subset of the given set |
static String |
trim(String s,
int length)
Trim a string to have given length |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ToolBox()
Method Detail |
---|
public static int random(int limit)
public static Object random(Collection set)
public static Collection subSet(Collection set, double part)
set
- setpart
- probability of selection of an element into the resultant subsetpublic static Collection subSet(Collection set, double part, int minSize)
set
- setpart
- probability of selection of an element into the resultant subsetminSize
- minimal size of the returned subsetpublic static String trim(String s, int length)
public static String col2string(Collection col, int tab)
public static String dict2string(Dictionary dict, int tab)
public static double rms(int n, double x, double x2)
n
- number of testsx
- total value of all testsx2
- total value^2 of all testspublic static Enumeration sortEnumeration(Enumeration e)
e
- an enumeration
public static Enumeration sortEnumeration(Enumeration e, Comparator c)
e
- an enumerationc
- comparator of two objects in enumeration e
public static void merge(Vector target, Collection source)
public static Vector intersect(Collection source1, Collection source2)
public static void setSeed(long seed)
getRandom()
and random()
methods.
public static long getSeed()
public static Random getRandom()
public static double random()
public static void configureLogging()
public static String configureLogging(String logDir, Properties properties)
logDir
- output folderproperties
- some other log4j propertiespublic static String configureLogging(String logDir, Properties properties, boolean timeInFileName)
public static String configureLogging(String logDir, Properties properties, boolean timeInFileName, boolean includeSystemOuts)
logDir
- output folderproperties
- some other log4j propertiestimeInFileName
- if true log file is named debug_yyyy-MM-dd_(HH.mm.ss).log, it is named debug.log otherwisepublic static DataProperties loadProperties(File propertyFile)
public static boolean equals(Object o1, Object o2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |