org.dllearner.utilities
Class StringFormatter

java.lang.Object
  extended by org.dllearner.utilities.StringFormatter

public class StringFormatter
extends Object


Constructor Summary
StringFormatter()
           
 
Method Summary
static String checkIfDirEndsOnSlashAndRemove(String dir)
           
static String convertStatDoubleToLatex(Stat s, int decimals, boolean includeSTDDeviation)
           
static String convertStatDoubleToLatex(Stat s, int decimals, String before, String after, boolean includeSTDDeviation)
           
static String convertStatPercentageToLatex(Stat s, int decimals, boolean addPercentSign, boolean includeSTDDeviation)
           
static String doubleRound(double d, int decimals, String before, String after)
           
static String doubleToPercent(double d)
          formats a double value between 0 and 100 to a percentage ex: 0.7854684 will be return 78.5%
static String doubleToPercent(double d, int decimals)
           
static String doubleToPercent(double d, int decimals, boolean addPercentSign)
           
static boolean isWhitespace(String str)
           
static void main(String[] args)
           
static String myReplaceAll(String s, char search, String replacement)
          used for regex difficult chars like _ or %
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringFormatter

public StringFormatter()
Method Detail

doubleToPercent

public static String doubleToPercent(double d)
formats a double value between 0 and 100 to a percentage ex: 0.7854684 will be return 78.5%

Parameters:
d -

doubleToPercent

public static String doubleToPercent(double d,
                                     int decimals)

myReplaceAll

public static String myReplaceAll(String s,
                                  char search,
                                  String replacement)
used for regex difficult chars like _ or %

Parameters:
s -
search -
replacement -
Returns:

doubleToPercent

public static String doubleToPercent(double d,
                                     int decimals,
                                     boolean addPercentSign)

doubleRound

public static String doubleRound(double d,
                                 int decimals,
                                 String before,
                                 String after)

convertStatPercentageToLatex

public static String convertStatPercentageToLatex(Stat s,
                                                  int decimals,
                                                  boolean addPercentSign,
                                                  boolean includeSTDDeviation)

convertStatDoubleToLatex

public static String convertStatDoubleToLatex(Stat s,
                                              int decimals,
                                              boolean includeSTDDeviation)

convertStatDoubleToLatex

public static String convertStatDoubleToLatex(Stat s,
                                              int decimals,
                                              String before,
                                              String after,
                                              boolean includeSTDDeviation)

isWhitespace

public static boolean isWhitespace(String str)

main

public static void main(String[] args)

checkIfDirEndsOnSlashAndRemove

public static String checkIfDirEndsOnSlashAndRemove(String dir)


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann