org.jmol.util
public class TextFormat extends Object
Field Summary | |
---|---|
static DecimalFormat[] | formatters |
static String[] | formattingStrings |
static Boolean[] | useNumberLocalization |
Method Summary | |
---|---|
static String | format(float value, int width, int precision, boolean alignLeft, boolean zeroPad) |
static String | format(String value, int width, int precision, boolean alignLeft, boolean zeroPad) |
static String | formatDecimal(float value, int decimalDigits) |
static String | formatString(String strFormat, String key, String strT) |
static String | formatString(String strFormat, String key, float floatT) |
static String | formatString(String strFormat, String key, int intT) |
static String | formatString(String strFormat, String key, String strT, float floatT) |
static String | formatString(String strFormat, String key, String strT, float floatT, boolean doOne)
generic string formatter based on formatLabel in Atom
|
static boolean | isMatch(String s, String strWildcard, boolean checkStar, boolean allowInitialStar) |
static boolean | isWild(String s) |
static void | lFill(StringBuffer s, String s1, String s2) |
static String | replaceAllCharacters(String str, String strFrom, String strTo)
Does a clean replace of any of the characters in str with strTo
If strTo contains strFrom, then only a single pass is done.
|
static String | replaceAllCharacters(String str, String strFrom, char chTo)
Does a clean replace of any of the characters in str with chrTo
If strTo contains strFrom, then only a single pass is done.
|
static void | rFill(StringBuffer s, String s1, String s2) |
static String | safeTruncate(float f, int n) |
static void | setUseNumberLocalization(boolean TF) |
static String | simpleReplace(String str, String strFrom, String strTo)
Does a clean replace of strFrom in str with strTo
If strTo contains strFrom, then only a single pass is done.
|
static String[] | split(String text, String run)
proper splitting, even for Java 1.3 -- if the text ends in the run,
no new line is appended.
|
static String[] | split(String text, char ch) |
static String | sprintf(String strFormat, Object[] values) |
static String | sprintf(String strFormat, String[] sVal, float[] fVal) |
static String | sprintf(String strFormat, String[] sVal, float[] fVal, int[] iVal) |
static String | trim(String str, String chars) |
Parameters: strFormat .... %width.precisionKEY.... key any string to match strT replacement string or null floatT replacement float or Float.NaN doOne mimic sprintf
Returns: formatted string
Parameters: str strFrom strTo
Returns: replaced string
Parameters: str strFrom chTo
Returns: replaced string
Parameters: str strFrom strTo
Returns: replaced string
Parameters: text run
Returns: String array