public class Util
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Util.NullPrintStream
Utility to class to make a void print stream
|
static class |
Util.ProcessKillerShutdownHook |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
argMapToString(java.util.Map<java.lang.String,java.lang.String> argMap)
Returns a string containing the arguments sorted by their name and joined together
|
static java.util.List<java.util.List<java.lang.String>> |
cartesianProduct(java.util.List<java.util.List<java.lang.String>> sets)
Have a list of list of strings and need the cartesian product? Look no further!
|
static void |
copyFile(java.io.File sourceFile,
java.io.File destFile) |
static weka.core.Instances |
createDummyInstances(int numInstances,
int numClasses,
int numUsefulNumeric,
int numUsefulCategorical,
int numRandomNumeric,
int numRandomCategorical,
int randomCategoricalSize,
int seed)
Makes a simple real valued dataset of a given size, with the class determined by index
|
static java.lang.String |
expandEnvironmentVariable(java.lang.String var)
Tries to evaluate the environment variable into something useful.
|
static java.lang.String |
expandPath(java.lang.String path)
Tries to resolve any relative paths/symlinks on a given path
|
static java.io.File |
findExecutableOnPath(java.lang.String executableName)
Tries to find the given executable on the path
|
static java.lang.String |
getAbsoluteClasspath() |
static java.lang.String |
getAutoWekaDistributionPath() |
static java.lang.String |
getJavaExecutable()
Tries to get the full path to the Java Executable that we're running
|
static java.lang.String |
joinStrings(java.lang.String delim,
java.util.Collection<java.lang.String> strs)
Joins a collection of strings together sepeated by a delim in the middle
|
static java.lang.String |
joinStrings(java.lang.String delim,
java.lang.String... strs)
Joins a list of strings together sepeated by a delim in the middle
|
static weka.core.Instances |
loadDataSource(java.io.InputStream stream) |
static void |
makePath(java.lang.String basePath)
Makes folders along the specified path
|
static void |
parseCommandLineProperties(java.util.Properties props,
java.util.List<java.lang.String> cmdLineArgs)
Looks for command line arguments of the form -prop PROPERTYSTRING and adds them to the given properties object
|
static void |
parseCommandLineProperties(java.util.Properties props,
java.lang.String[] cmdLineArgs)
Looks for command line arguments of the form -prop PROPERTYSTRING and adds them to the given properties object
|
static void |
parsePropertyString(java.util.Properties props,
java.lang.String propStr)
Given a property string (var1=val1:var2=val2:....) convert it to a property object.
|
static java.util.Properties |
parsePropertyString(java.lang.String propStr)
Given a property string (var1=val1:var2=val2:....) convert it to a property object.
|
static java.lang.String |
propertiesToString(java.util.Properties props)
Converts a Properties object to a property string, escaping ':' as needed
|
static java.util.List<java.lang.String> |
quoteStrings(java.util.Collection<java.lang.String> oldStrs)
Looks for any strings that have spaces in them, and surrounds them with quotes
|
static java.lang.String |
removeExtension(java.lang.String s)
Gets the basename of a file
|
static java.util.Map<java.lang.String,java.lang.String> |
removeHidden(java.util.Map<java.lang.String,java.lang.String> inputMap)
Removes any arguments in the inputMap that happen to have a HIDDEN in their name
|
static java.util.List<java.lang.String> |
splitNestedString(java.lang.String params,
java.lang.String delimStr,
int numLeft,
int numRight)
Splits a string, returning the string separated by the delimiter, with only the numLeft and numRight taken from the appropriate sides
|
static java.util.List<java.lang.String> |
splitQuotedString(java.lang.String str)
Splits a string based on spaces, grouping atoms if they are inside non escaped double quotes.
|
public static java.util.Properties parsePropertyString(java.lang.String propStr)
public static void parsePropertyString(java.util.Properties props, java.lang.String propStr)
public static java.lang.String propertiesToString(java.util.Properties props)
public static void parseCommandLineProperties(java.util.Properties props, java.lang.String[] cmdLineArgs)
public static void parseCommandLineProperties(java.util.Properties props, java.util.List<java.lang.String> cmdLineArgs)
public static void makePath(java.lang.String basePath)
public static java.lang.String getAbsoluteClasspath()
public static java.lang.String getJavaExecutable()
public static java.io.File findExecutableOnPath(java.lang.String executableName)
public static java.lang.String expandEnvironmentVariable(java.lang.String var)
public static java.lang.String expandPath(java.lang.String path)
public static java.util.List<java.util.List<java.lang.String>> cartesianProduct(java.util.List<java.util.List<java.lang.String>> sets)
public static java.lang.String argMapToString(java.util.Map<java.lang.String,java.lang.String> argMap)
public static java.util.Map<java.lang.String,java.lang.String> removeHidden(java.util.Map<java.lang.String,java.lang.String> inputMap)
public static java.lang.String removeExtension(java.lang.String s)
public static java.lang.String joinStrings(java.lang.String delim, java.lang.String... strs)
public static java.lang.String joinStrings(java.lang.String delim, java.util.Collection<java.lang.String> strs)
public static java.util.List<java.lang.String> quoteStrings(java.util.Collection<java.lang.String> oldStrs)
public static java.util.List<java.lang.String> splitNestedString(java.lang.String params, java.lang.String delimStr, int numLeft, int numRight)
public static weka.core.Instances createDummyInstances(int numInstances, int numClasses, int numUsefulNumeric, int numUsefulCategorical, int numRandomNumeric, int numRandomCategorical, int randomCategoricalSize, int seed)
public static java.lang.String getAutoWekaDistributionPath()
public static java.util.List<java.lang.String> splitQuotedString(java.lang.String str)
public static weka.core.Instances loadDataSource(java.io.InputStream stream) throws java.lang.Exception
java.lang.Exception
public static void copyFile(java.io.File sourceFile, java.io.File destFile)