|
||||||||||
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 java.lang.String[] |
forbiddenCharacters
Forbidden characters in file names |
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static java.lang.String |
color2Hex(java.awt.Color color)
Converts a color to hex format for use in HTML tags. |
static boolean |
containsForbiddenCharacter(java.lang.String string)
Indicates whether a string contains characters forbidden in file names |
static void |
copyFile(java.io.File in,
java.io.File out)
Copy the content of one file to another. |
static boolean |
deleteDir(java.io.File dir)
Deletes all files and subdirectories under dir. |
static java.lang.String |
getFileName(java.lang.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 double |
roundDouble(double d,
int places)
Rounds a double value to the wanted number of decimal places. |
static void |
tableToFile(javax.swing.JTable table,
java.lang.String separator,
ProgressDialogX progressDialog,
boolean removeHtml,
java.io.BufferedWriter writer)
Writes the table to a file as separated text. |
static java.lang.String |
tableToText(javax.swing.JTable table,
java.lang.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 java.lang.String[] forbiddenCharacters
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static boolean containsForbiddenCharacter(java.lang.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(java.io.File dir)
dir
-
public static double getPpmError(double theoreticalMzValue, double massError)
theoreticalMzValue
- the theoretical massmassError
- the mass error
public static java.lang.String color2Hex(java.awt.Color color)
color
- the color to convert
public static java.lang.String getFileName(java.lang.String filePath)
filePath
- the file path as a string
public static java.lang.String tableToText(javax.swing.JTable table, java.lang.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(javax.swing.JTable table, java.lang.String separator, ProgressDialogX progressDialog, boolean removeHtml, java.io.BufferedWriter writer) throws java.io.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
java.io.IOException
public static void copyFile(java.io.File in, java.io.File out) throws java.io.IOException
in
- the file to copy fromout
- the file to copy to
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |