|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sri.emo.wizard.creation.StringUtil
public class StringUtil
Created by Richard Vorp to include all of the utility function which deal with string manipulation or string creation
Field Summary | |
---|---|
static int |
CENTER_ALIGN
|
static int |
LEFT_ALIGN
|
static NumberFormat |
nf
|
static int |
RIGHT_ALIGN
|
Method Summary | |
---|---|
static String |
appendIfNotExist(String originalString,
String appendString)
|
static String |
buffer(NumberFormat nf,
double value,
int length)
inserts a double value into a buffer of size length. |
static String |
buffer(String txt,
int length)
inserts a String txt into a buffer of size length. |
static String |
buffer(String txt,
int length,
int alignment)
inserts a String txt into a buffer of size length. |
static String |
bufferCenterAlign(String txt,
int length)
inserts a String txt into a buffer of size length. |
static String |
bufferNoTrim(String txt,
int length)
inserts a String txt into a buffer of size length. |
static String |
bufferRightAlign(double value,
int numFracDigits,
int length)
Makes a right aligned string buffer out of double. |
static String |
bufferRightAlign(String txt,
int length)
inserts a String txt into a buffer of size length. |
static String |
bufferRightAlign(String txt,
String bufferTxt,
int length)
|
static boolean |
contains(String parent,
String child)
tests to see whether the child string is contained within the parent |
static int |
countNonEmptyStrings(String[] text)
|
static String |
createString(char val,
int width)
|
static String |
createString(String val,
int width)
|
static String |
createString(String val,
int width,
int height)
Creates a string with VAL repeated WIDTH times in a line and height many lines. |
static String |
format(double value,
int maxFracDigits)
|
static String |
getIth(int number)
|
static String |
getPlural(String text,
int number)
|
static int |
indexOf(String string,
String searchCharacters)
Finds the first index of any character (represented by searchCharacter) within the string. |
static String |
longestString(Iterator iter)
|
static String |
longestString(List stringList)
Determines he first longest from a list of strings |
static String |
longestString(Object[] stringArray)
Determines he first longest from a array of strings |
static double[] |
parseDoubleTokens(String s,
String delimit)
|
static int[] |
parseIntegerTokens(String s,
String delimit)
|
static String |
removeOuterChar(String s,
char leftOuter,
char rightOuter)
|
static String |
removeOuterChars(String s,
char leftOuter,
char rightOuter)
|
static String |
removeQuotes(String s)
|
static String |
removeQuotesNoTrim(String s)
|
static String |
space(int times)
|
static String |
toString(boolean[] values)
|
static String |
toString(boolean[][] values)
|
static String |
toString(boolean[][] values,
String firstDimStart,
String firstDimSeparator,
String firstDimEnd,
String secondDimStart,
String secondDimSeparator,
String secondDimEnd)
|
static String |
toString(boolean[] values,
String start,
String separator,
String end)
|
static String |
toString(Collection c)
|
static String |
toString(Collection c,
String start,
String end)
|
static String |
toString(Collection c,
String start,
String separator,
String end)
|
static String |
toString(double[] values)
|
static String |
toString(double[][] values)
|
static String |
toString(double[][][] values)
|
static String |
toString(double[][][] values,
String firstDimStart,
String firstDimEnd,
String firstDimSeparator,
String secondDimStart,
String secondDimSeparator,
String secondDimEnd,
String thirdDimStart,
String thirdDimSeparator,
String thirdDimEnd)
|
static String |
toString(double[][] values,
String firstDimStart,
String firstDimSeparator,
String firstDimEnd,
String secondDimStart,
String secondDimSeparator,
String secondDimEnd)
|
static String |
toString(double[] values,
String start,
String separator,
String end)
|
static String |
toString(Enumeration enumeration)
|
static String |
toString(Enumeration iterator,
String start,
String separator,
String end)
|
static String |
toString(int[] values)
|
static String |
toString(int[][] values)
|
static String |
toString(int[][] values,
String firstDimStart,
String firstDimSeparator,
String firstDimEnd,
String secondDimStart,
String secondDimSeparator,
String secondDimEnd)
|
static String |
toString(int[] values,
String start,
String separator,
String end)
|
static String |
toString(Iterator iterator)
|
static String |
toString(Iterator iterator,
String start,
String separator,
String end)
|
static String |
toString(Map map)
|
static String |
toString(Object[] values)
|
static String |
toString(Object[] values,
String start,
String separator,
String end)
|
static String |
toString(String[] strArray)
|
static String |
toStringLn(Object[] values)
|
static String |
trim(String line,
char trimCharacter)
|
static String |
wrap(String text,
int maxLength)
|
static List |
wrapLines(String text,
int maxLength)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LEFT_ALIGN
public static final int CENTER_ALIGN
public static final int RIGHT_ALIGN
public static NumberFormat nf
Method Detail |
---|
public static int indexOf(String string, String searchCharacters)
string
- StringsearchCharacters
- String
public static String toString(Map map)
public static String getIth(int number)
public static String toString(String[] strArray)
public static String toString(Collection c)
public static String toString(Collection c, String start, String end)
public static String toString(Collection c, String start, String separator, String end)
public static String toString(Enumeration enumeration)
public static String toString(Enumeration iterator, String start, String separator, String end)
public static String toString(Iterator iterator)
public static String toString(Iterator iterator, String start, String separator, String end)
public static String toString(Object[] values)
public static String toStringLn(Object[] values)
public static String toString(Object[] values, String start, String separator, String end)
public static String toString(int[] values)
public static String toString(int[] values, String start, String separator, String end)
public static String toString(int[][] values)
public static String toString(int[][] values, String firstDimStart, String firstDimSeparator, String firstDimEnd, String secondDimStart, String secondDimSeparator, String secondDimEnd)
public static String toString(double[] values, String start, String separator, String end)
public static String toString(boolean[] values, String start, String separator, String end)
public static String toString(double[] values)
public static String toString(boolean[] values)
public static String toString(double[][][] values, String firstDimStart, String firstDimEnd, String firstDimSeparator, String secondDimStart, String secondDimSeparator, String secondDimEnd, String thirdDimStart, String thirdDimSeparator, String thirdDimEnd)
public static String toString(double[][][] values)
public static String toString(double[][] values, String firstDimStart, String firstDimSeparator, String firstDimEnd, String secondDimStart, String secondDimSeparator, String secondDimEnd)
public static String toString(double[][] values)
public static String toString(boolean[][] values)
public static String toString(boolean[][] values, String firstDimStart, String firstDimSeparator, String firstDimEnd, String secondDimStart, String secondDimSeparator, String secondDimEnd)
public static boolean contains(String parent, String child)
parent
- child
-
public static int countNonEmptyStrings(String[] text)
public static String createString(char val, int width)
public static String createString(String val, int width, int height)
val
- width
- height
-
public static String createString(String val, int width)
public static String space(int times)
public static String buffer(String txt, int length, int alignment)
txt
- String to fit in a bufferlength
- alignment
-
public static List wrapLines(String text, int maxLength)
public static String wrap(String text, int maxLength)
public static String buffer(String txt, int length)
txt
- length
-
public static String bufferNoTrim(String txt, int length)
txt
- length
-
public static String bufferRightAlign(String txt, int length)
public static String bufferRightAlign(String txt, String bufferTxt, int length)
public static String buffer(NumberFormat nf, double value, int length)
public static String bufferCenterAlign(String txt, int length)
public static String bufferRightAlign(double value, int numFracDigits, int length)
value
- double value to be made into stringnumFracDigits
- number digits after fraction dot.
public static String removeOuterChar(String s, char leftOuter, char rightOuter)
public static String removeOuterChars(String s, char leftOuter, char rightOuter)
public static String trim(String line, char trimCharacter)
public static String removeQuotesNoTrim(String s)
public static String removeQuotes(String s)
public static String format(double value, int maxFracDigits)
public static String longestString(List stringList)
stringList
-
public static String longestString(Iterator iter)
public static String longestString(Object[] stringArray)
stringArray
-
public static String getPlural(String text, int number)
public static int[] parseIntegerTokens(String s, String delimit)
public static double[] parseDoubleTokens(String s, String delimit)
public static String appendIfNotExist(String originalString, String appendString)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |