|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.forester.util.ForesterUtil
public final class ForesterUtil
Nested Class Summary | |
---|---|
static class |
ForesterUtil.PhylogenyNodeField
|
Field Summary | |
---|---|
static String |
FILE_SEPARATOR
|
static NumberFormat |
FORMATTER_06
|
static NumberFormat |
FORMATTER_3
|
static NumberFormat |
FORMATTER_6
|
static NumberFormat |
FORMATTER_9
|
static String |
JAVA_VENDOR
|
static String |
JAVA_VERSION
|
static String |
LINE_SEPARATOR
|
static BigDecimal |
NULL_BD
|
static String |
OS_ARCH
|
static String |
OS_NAME
|
static String |
OS_VERSION
|
static double |
ZERO_DIFF
|
Method Summary | |
---|---|
static void |
appendSeparatorIfNotEmpty(StringBuffer sb,
char separator)
|
static Color |
calcColor(double value,
double min,
double max,
Color minColor,
Color maxColor)
This calculates a color. |
static Color |
calcColor(double value,
double min,
double max,
double mean,
Color minColor,
Color maxColor,
Color meanColor)
This calculates a color. |
static String |
collapseWhiteSpace(String s)
|
static String |
colorToHex(Color color)
|
static int |
countChars(String str,
char c)
|
static BufferedWriter |
createBufferedWriter(File file)
|
static BufferedWriter |
createBufferedWriter(String name)
|
static File |
createFileForWriting(String name)
|
static PhylogenyParser |
createParserDependingFileContents(File file,
boolean phyloxml_validate_against_xsd)
|
static PhylogenyParser |
createParserDependingOnFileType(File file,
boolean phyloxml_validate_against_xsd)
|
static PhylogenyParser |
createParserDependingOnSuffix(String filename,
boolean phyloxml_validate_against_xsd)
Return null if it can not guess the parser to use based on name suffix. |
static PhylogenyParser |
createParserDependingOnUrlContents(URL url,
boolean phyloxml_validate_against_xsd)
|
static void |
ensurePresenceOfDate(PhylogenyNode node)
|
static void |
ensurePresenceOfDistribution(PhylogenyNode node)
|
static void |
ensurePresenceOfSequence(PhylogenyNode node)
|
static void |
ensurePresenceOfTaxonomy(PhylogenyNode node)
|
static void |
fatalError(String prg_name,
String message)
|
static String[] |
file2array(File file)
|
static List<String> |
file2list(File file)
|
static SortedSet<String> |
file2set(File file)
|
static String |
getCurrentDateTime()
|
static String |
getFileSeparator()
|
static String |
getFirstLine(Object source)
|
static String |
getLineSeparator()
|
static Hashtable<String,Boolean> |
getPropertyRefs(Phylogeny phylogeny)
Returns all custom data tag names of this Phylogeny as Hashtable. |
static void |
increaseCountingMap(Map<String,Integer> counting_map,
String item_name)
|
static boolean |
isAllNonEmptyInternalLabelsArePositiveNumbers(Phylogeny phy)
|
static boolean |
isEmpty(String s)
|
static boolean |
isEqual(double a,
double b)
|
static boolean |
isEven(int n)
|
static boolean |
isHasAtLeastNodeWithEvent(Phylogeny phy)
|
static boolean |
isHasAtLeastOneBranchLengthLargerThanZero(Phylogeny phy)
Returns true if at least one branch has a length larger than zero. |
static boolean |
isHasAtLeastOneBranchWithSupportValues(Phylogeny phy)
|
static boolean |
isIntersecting(String[] a,
String[] b)
This determines whether String[] a and String[] b have at least one String in common (intersect). |
static double |
isLargerOrEqualToZero(double d)
|
static boolean |
isNull(BigDecimal s)
|
static String |
isReadableFile(File f)
|
static String |
isReadableFile(String s)
|
static String |
isWritableFile(File f)
|
static int |
limitRangeForColor(int i)
Helper for method "stringToColor". |
static SortedMap<Object,Integer> |
listToSortedCountsMap(List list)
|
static StringBuffer |
mapToStringBuffer(Map map,
String key_value_separator)
|
static String |
normalizeString(String s,
int length,
boolean left_pad,
char pad_char)
|
static BufferedReader |
obtainReader(Object source)
|
static StringBuffer |
pad(double number,
int size,
char pad,
boolean left_pad)
|
static StringBuffer |
pad(StringBuffer string,
int size,
char pad,
boolean left_pad)
|
static StringBuffer |
pad(String string,
int size,
char pad,
boolean left_pad)
|
static double |
parseDouble(String str)
|
static int |
parseInt(String str)
|
static void |
postOrderRelabelInternalNodes(Phylogeny phylogeny,
int starting_number)
|
static void |
printArray(Object[] a)
|
static void |
printCountingMap(Map<String,Integer> counting_map)
|
static void |
printErrorMessage(String prg_name,
String message)
|
static void |
printProgramInformation(String prg_name,
String prg_version,
String date)
|
static void |
printProgramInformation(String prg_name,
String prg_version,
String date,
String email,
String www)
|
static void |
printWarningMessage(String prg_name,
String message)
|
static void |
programMessage(String prg_name,
String message)
|
static String |
removeSuffix(String file_name)
|
static String |
removeWhiteSpace(String s)
Removes all white space from String s. |
static String |
replaceIllegalNhCharacters(String nh)
|
static String |
replaceIllegalNhxCharacters(String nhx)
|
static double |
round(double value,
int decimal_place)
|
static int |
roundToInt(double d)
Rounds d to an int. |
static int |
roundToInt(float f)
|
static String |
sanitizeString(String s)
|
static String |
stringArrayToString(String[] a)
|
static void |
transferInternalNamesToBootstrapSupport(Phylogeny phy)
|
static void |
transferInternalNodeNamesToConfidence(Phylogeny phy)
|
static void |
transferNodeNameToField(Phylogeny phy,
ForesterUtil.PhylogenyNodeField field)
|
static void |
unexpectedFatalError(String prg_name,
Exception e)
|
static void |
unexpectedFatalError(String prg_name,
String message)
|
static void |
unexpectedFatalError(String prg_name,
String message,
Exception e)
|
static String |
wordWrap(String str,
int width)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FILE_SEPARATOR
public static final String LINE_SEPARATOR
public static final String JAVA_VENDOR
public static final String JAVA_VERSION
public static final String OS_ARCH
public static final String OS_NAME
public static final String OS_VERSION
public static final double ZERO_DIFF
public static final BigDecimal NULL_BD
public static final NumberFormat FORMATTER_9
public static final NumberFormat FORMATTER_6
public static final NumberFormat FORMATTER_06
public static final NumberFormat FORMATTER_3
Method Detail |
---|
public static final void appendSeparatorIfNotEmpty(StringBuffer sb, char separator)
public static final Color calcColor(double value, double min, double max, Color minColor, Color maxColor)
value
- the valuemin
- the smallest valuemax
- the largest valueminColor
- the color for minmaxColor
- the color for max
public static final Color calcColor(double value, double min, double max, double mean, Color minColor, Color maxColor, Color meanColor)
value
- the valuemin
- the smallest valuemax
- the largest valuemean
- the mean/median valueminColor
- the color for minmaxColor
- the color for maxmeanColor
- the color for mean
public static final String collapseWhiteSpace(String s)
public static final String colorToHex(Color color)
public static final int countChars(String str, char c)
public static final BufferedWriter createBufferedWriter(File file) throws IOException
IOException
public static final BufferedWriter createBufferedWriter(String name) throws IOException
IOException
public static final File createFileForWriting(String name) throws IOException
IOException
public static final PhylogenyParser createParserDependingFileContents(File file, boolean phyloxml_validate_against_xsd) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static final PhylogenyParser createParserDependingOnFileType(File file, boolean phyloxml_validate_against_xsd) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static final PhylogenyParser createParserDependingOnSuffix(String filename, boolean phyloxml_validate_against_xsd)
filename
-
public static final PhylogenyParser createParserDependingOnUrlContents(URL url, boolean phyloxml_validate_against_xsd) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static final void ensurePresenceOfDate(PhylogenyNode node)
public static final void ensurePresenceOfDistribution(PhylogenyNode node)
public static void ensurePresenceOfSequence(PhylogenyNode node)
public static void ensurePresenceOfTaxonomy(PhylogenyNode node)
public static void fatalError(String prg_name, String message)
public static String[] file2array(File file) throws IOException
IOException
public static final List<String> file2list(File file) throws IOException
IOException
public static final SortedSet<String> file2set(File file) throws IOException
IOException
public static final String getCurrentDateTime()
public static final String getFileSeparator()
public static final String getFirstLine(Object source) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public static final String getLineSeparator()
public static final Hashtable<String,Boolean> getPropertyRefs(Phylogeny phylogeny)
public static final void increaseCountingMap(Map<String,Integer> counting_map, String item_name)
public static final boolean isAllNonEmptyInternalLabelsArePositiveNumbers(Phylogeny phy)
public static final boolean isEmpty(String s)
public static final boolean isEqual(double a, double b)
public static final boolean isEven(int n)
public static final boolean isHasAtLeastNodeWithEvent(Phylogeny phy)
public static final boolean isHasAtLeastOneBranchLengthLargerThanZero(Phylogeny phy)
phy
- public static final boolean isHasAtLeastOneBranchWithSupportValues(Phylogeny phy)
public static final boolean isIntersecting(String[] a, String[] b)
a
- a String[] b a String[]
public static final double isLargerOrEqualToZero(double d)
public static final boolean isNull(BigDecimal s)
public static final String isReadableFile(File f)
public static final String isReadableFile(String s)
public static final String isWritableFile(File f)
public static final String wordWrap(String str, int width)
public static final int limitRangeForColor(int i)
(Last modified: 12/20/03)
public static final SortedMap<Object,Integer> listToSortedCountsMap(List list)
public static final StringBuffer mapToStringBuffer(Map map, String key_value_separator)
public static final String normalizeString(String s, int length, boolean left_pad, char pad_char)
public static final BufferedReader obtainReader(Object source) throws IOException, FileNotFoundException
IOException
FileNotFoundException
public static final StringBuffer pad(double number, int size, char pad, boolean left_pad)
public static final StringBuffer pad(String string, int size, char pad, boolean left_pad)
public static final StringBuffer pad(StringBuffer string, int size, char pad, boolean left_pad)
public static final double parseDouble(String str) throws ParseException
ParseException
public static final int parseInt(String str) throws ParseException
ParseException
public static final void postOrderRelabelInternalNodes(Phylogeny phylogeny, int starting_number)
public static final void printArray(Object[] a)
public static final void printCountingMap(Map<String,Integer> counting_map)
public static final void printErrorMessage(String prg_name, String message)
public static final void printProgramInformation(String prg_name, String prg_version, String date)
public static final void printProgramInformation(String prg_name, String prg_version, String date, String email, String www)
public static final void printWarningMessage(String prg_name, String message)
public static final void programMessage(String prg_name, String message)
public static final String removeSuffix(String file_name)
public static final String removeWhiteSpace(String s)
public static final String replaceIllegalNhCharacters(String nh)
public static final String replaceIllegalNhxCharacters(String nhx)
public static final double round(double value, int decimal_place)
public static final int roundToInt(double d)
public static final int roundToInt(float f)
public static final String sanitizeString(String s)
public static final String stringArrayToString(String[] a)
public static final void transferInternalNamesToBootstrapSupport(Phylogeny phy)
public static final void transferInternalNodeNamesToConfidence(Phylogeny phy)
public static final void transferNodeNameToField(Phylogeny phy, ForesterUtil.PhylogenyNodeField field)
public static final void unexpectedFatalError(String prg_name, Exception e)
public static final void unexpectedFatalError(String prg_name, String message)
public static final void unexpectedFatalError(String prg_name, String message, Exception e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |