|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.cunit.util.StringOps
public class StringOps
String operations.
| Nested Class Summary | |
|---|---|
static interface |
StringOps.MatchResult
|
private static class |
StringOps.MatchResultDelegate
|
static class |
StringOps.StringOpsTest
Test cases. |
| Constructor Summary | |
|---|---|
StringOps()
|
|
| Method Summary | |
|---|---|
static StringOps.MatchResult |
match(java.lang.String s,
java.lang.String pattern)
Return the match result of the regex pattern in the string s, beginning at 0. |
static StringOps.MatchResult |
match(java.lang.String s,
java.lang.String pattern,
int start)
Return the match result of the regex pattern in the string s, beginning at start. |
static java.lang.String |
replaceVariables(java.lang.String str,
java.util.Hashtable<java.lang.Object,java.lang.Object> table)
Replace variables of the form "%variable%" with the value associated with the string "variable" in the provided hash table. |
static boolean |
stringMatches(java.lang.String str,
char separatorChar,
java.lang.String... stringPatterns)
Returns true if the specified string matches one of the patterns. |
static java.lang.String |
toStringMillis(long millis)
Return a human-readable representation of a duration in milliseconds, up to days. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringOps()
| Method Detail |
|---|
public static java.lang.String toStringMillis(long millis)
millis - length of time in milliseconds
public static java.lang.String replaceVariables(java.lang.String str,
java.util.Hashtable<java.lang.Object,java.lang.Object> table)
str - input stringtable - hash table with variable-value pairs
public static boolean stringMatches(java.lang.String str,
char separatorChar,
java.lang.String... stringPatterns)
str - stringseparatorChar - the character that ends matches of * but not of *** ('.', '/' or '\\' supported)stringPatterns - variable argument list of patterns
public static StringOps.MatchResult match(java.lang.String s,
java.lang.String pattern,
int start)
s - the original stringpattern - the regexstart - the character offset where to start
public static StringOps.MatchResult match(java.lang.String s,
java.lang.String pattern)
s - the original stringpattern - the regex
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||