|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simbrain.util.Utils
public class Utils
Utils.
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | |
|---|---|
static float |
colorToFloat(Color clr)
returns the Hue associated with a Color. |
static boolean |
containsName(ArrayList al,
String theString)
Checks whether an array list cantains a name, and warns you if it does. |
static String |
doubleArrayToString(double[] data)
Utility to class to convert arrays of doubles to strings. |
static Color |
floatToHue(float fclr)
Converts a floating point value into a color in HSB, with Saturation and Brightness 1. |
static String |
getDir(File theFile)
Get the directory component of a file. |
static double[][] |
getDoubleMatrix(File theFile)
Read a csv (comma-separated-values) files. |
static String |
getNameFromPath(String thePath)
Extract file name from a path description. |
static String |
getRelativePath(String baseDir,
String absolutePath)
Helper method to create a relative path for use in saving simulation files which refer to files within directories. |
static String[][] |
getStringMatrix(File theFile)
Read a csv (comma-separated-values) files. |
static String |
getVectorString(double[] theVec,
String delimiter)
Convert an array of doubles into a String. |
static double[] |
getVectorString(String theVec,
String delimiter)
Convert a delimeted string of doubles into an array of doubles. |
static String |
round(double num,
int precision)
|
static void |
showQuickRef()
Shows the quick reference guide in the help menu. |
static void |
showQuickRef(String helpPage)
Shows the quick reference guide in the help menu. |
static double[] |
stringArrayToDoubleArray(String[] line)
Converts an array of strings containing doubles into an array of values. |
static void |
writeMatrix(String[][] data,
File theFile)
Save data as CSV (comma-separated-value) file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static double[][] getDoubleMatrix(File theFile)
theFile - the file to read in
public static String[][] getStringMatrix(File theFile)
theFile - the file to read in
public static void writeMatrix(String[][] data,
File theFile)
data - Data to be writtentheFile - File to be written to
public static String getRelativePath(String baseDir,
String absolutePath)
baseDir - absolute path of the local simbrain directory.absolutePath - the absolute path of the file to be saved
public static String getNameFromPath(String thePath)
thePath - the path
public static String getDir(File theFile)
theFile - the file to get the directory of.
public static String getVectorString(double[] theVec,
String delimiter)
theVec - the array of doubles to convertdelimiter - Delimiter
public static double[] getVectorString(String theVec,
String delimiter)
theVec - string version of vectordelimiter - delimeter used in that string
public static double[] stringArrayToDoubleArray(String[] line)
line - the array of strings
public static String doubleArrayToString(double[] data)
data - array of doubles
public static String round(double num,
int precision)
num - double to convertprecision - number of decimal places
public static boolean containsName(ArrayList al,
String theString)
al - the array list to check; must be an array of stringstheString - the name to check for
public static void showQuickRef()
public static Color floatToHue(float fclr)
fclr - Float color
public static float colorToFloat(Color clr)
clr - Color
public static void showQuickRef(String helpPage)
helpPage - Help page
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||