|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.util.StringUtil
public final class StringUtil
Some utils for Strings
| Nested Class Summary | |
|---|---|
static class |
StringUtil.TextPos
Local class, for reposting positions in a String in the form of (line-number, line-pos). |
| Constructor Summary | |
|---|---|
private |
StringUtil()
|
| Method Summary | |
|---|---|
static int |
diff(String s1,
String s2)
Returns the index where String s1 and s2 differ for the first time, or returns -1 if they actually equal strings. |
static StringUtil.TextPos |
diffPos(String s1,
String s2)
Returns the TextPos where the two string differ for the first time. |
static int |
getLineNumber(String s,
int charPos)
Counts the line number within a specified String, for a specified position inside that String. |
static int |
getLinePos(String s,
int charPos)
Gets the line position of some character within a String, i.e the position within the line where the character occurs. |
static StringUtil.TextPos |
getTextPos(String s,
int charPos)
|
static boolean |
isInteger(String s)
|
static boolean |
isNumeric(String inputData)
|
static boolean |
isPostiveInteger(String s)
|
static String |
showDiff(String s1,
String s2)
Returns a String showing whether their length are equal and if so, where the first difference between two Strings occurs. |
static void |
splitToCollection(String str,
String sep,
Collection<String> c)
Add the trimmed elements of a String str seperated by some seperator sep to collection c |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
private StringUtil()
| Method Detail |
|---|
public static void splitToCollection(String str,
String sep,
Collection<String> c)
public static boolean isNumeric(String inputData)
public static boolean isInteger(String s)
public static boolean isPostiveInteger(String s)
public static int diff(String s1,
String s2)
public static StringUtil.TextPos diffPos(String s1,
String s2)
public static String showDiff(String s1,
String s2)
public static int getLineNumber(String s,
int charPos)
public static int getLinePos(String s,
int charPos)
public static StringUtil.TextPos getTextPos(String s,
int charPos)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||