|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.Util
public class Util
Includes general help methods that are used by the other classes.
Field Summary | |
---|---|
static String[] |
forbiddenCharacters
Forbidden characters in file names. |
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static String |
color2Hex(Color color)
Converts a color to hex format for use in HTML tags. |
static boolean |
containsForbiddenCharacter(String string)
Indicates whether a string contains characters forbidden in file names. |
static void |
copyFile(File in,
File out)
Copy the content of one file to another. |
static boolean |
deleteDir(File dir)
Deletes all files and subdirectories under dir. |
static String |
getFileName(String filePath)
An OS independent getName alternative. |
static double |
getPpmError(double theoreticalMzValue,
double massError)
Returns the ppm value of the given mass error relative to its theoretical m/z value. |
static String |
removeForbiddenCharacters(String string)
Removes the forbidden characters from a string |
static double |
roundDouble(double d,
int places)
Rounds a double value to the wanted number of decimal places. |
static void |
tableToFile(JTable table,
String separator,
ProgressDialogX progressDialog,
boolean removeHtml,
BufferedWriter writer)
Writes the table to a file as separated text. |
static String |
tableToText(JTable table,
String separator,
ProgressDialogX progressDialog,
boolean removeHtml)
Returns the table as a separated text file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] forbiddenCharacters
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static String removeForbiddenCharacters(String string)
string
- the string of interest
public static boolean containsForbiddenCharacter(String string)
string
- the string of interest
public static double roundDouble(double d, int places)
d
- the double to round ofplaces
- number of decimal places wanted
public static boolean deleteDir(File dir)
dir
-
public static double getPpmError(double theoreticalMzValue, double massError)
theoreticalMzValue
- the theoretical massmassError
- the mass error
public static String color2Hex(Color color)
color
- the color to convert
public static String getFileName(String filePath)
filePath
- the file path as a string
public static String tableToText(JTable table, String separator, ProgressDialogX progressDialog, boolean removeHtml)
table
- the table to turn in to textseparator
- the text separatorprogressDialog
- the progress dialogremoveHtml
- if true, html is converted to text
public static void tableToFile(JTable table, String separator, ProgressDialogX progressDialog, boolean removeHtml, BufferedWriter writer) throws IOException
table
- the table to write to fileseparator
- the text separatorprogressDialog
- the progress dialogremoveHtml
- if true, html is converted to textwriter
- the writer where the file is to be written
IOException
public static void copyFile(File in, File out) throws IOException
in
- the file to copy fromout
- the file to copy to
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |