|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.Util
public class Util
Method Summary | |
---|---|
static void |
appendElement(Interp interp,
StringBuffer sbuf,
String s)
appendElement -- Append a string to the string buffer. |
static TclObject |
concat(int from,
int to,
TclObject[] objv)
Tcl_ConcatObj -> concat Concatenate the strings from a set of objects into a single string object with spaces between the original strings. |
static boolean |
getBoolean(Interp interp,
String string)
getBoolean -- Given a string, return a boolean value corresponding to the string. |
static long |
getInt(Interp interp,
String s)
Converts an ASCII string to an integer. |
static int |
getIntForIndex(Interp interp,
TclObject tobj,
int endValue)
TclGetIntForIndex -> Util.getIntForIndex This procedure returns an integer corresponding to the list index held in a Tcl object. |
static boolean |
isMac()
isMac -- Returns true if running on a Mac platform. |
static boolean |
isUnix()
isUnix -- Returns true if running on a Unix platform. |
static boolean |
isWindows()
isWindows -- Returns true if running on a Windows platform. |
static boolean |
regExpMatch(Interp interp,
String string,
TclObject pattern)
regExpMatch -- See if a string matches a regular expression. |
static boolean |
stringMatch(String str,
String pat)
stringMatch -- See if a particular string matches a particular pattern. |
static void |
strtod(String s,
int start,
int len,
StrtodResult strtodResult)
strtod -- Converts the leading decimal digits of a string into double and report the index of the character immediately following the digits. |
static void |
strtoul(String s,
int start,
int base,
StrtoulResult strtoulResult)
Implements functionality of the strtoul() function used in the C Tcl library. |
static String |
toTitle(String str)
Tcl_UtfToTitle -> toTitle -- Changes the first character of a string to title case or uppercase and the rest of the string to lowercase. |
static String |
TrimLeft(String str)
TrimLeft -- Trims whitespace on the left side of a strin.g Results: The trimmed string. |
static String |
TrimLeft(String str,
String pattern)
TrimLeft -- Trim characters in "pattern" off the left of a string If pattern isn't supplied, whitespace is trimmed Results: |>None.<| Side effects: |>None.<| |
static String |
TrimRight(String str)
|
static String |
TrimRight(String str,
String pattern)
TrimRight -- Trim characters in "pattern" off the right of a string If pattern isn't supplied, whitespace is trimmed Results: |>None.<| |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void strtoul(String s, int start, int base, StrtoulResult strtoulResult)
s
- String of ASCII digits, possibly preceded by white space. For
bases greater than 10, either lower- or upper-case digits may
be used.start
- The index of s where the number starts.base
- Base for conversion. Must be less than 37. If 0, then the base
is chosen from the leading characters of string: "0x" means
hex, "0" means octal, anything else means decimal.strtoulResult
- Location to store resultspublic static long getInt(Interp interp, String s) throws TclException
interp
- The current interpreter. Can be nulls
- The string to convert from. Must be in valid Tcl integer
format.
TclException
public static final int getIntForIndex(Interp interp, TclObject tobj, int endValue) throws TclException
interp
- interp, can be nulltobj
- the index object, an integer, "end", or "end-n"endValue
- the index value to use as "end"
TclException
public static void strtod(String s, int start, int len, StrtodResult strtodResult)
s
- String of ASCII digits, possibly preceded by white space. For
bases greater than 10, either lower- or upper-case digits may
be used.start
- The index of the string to start on.len
- The string length, or -1strtodResult
- place to store resultspublic static TclObject concat(int from, int to, TclObject[] objv) throws TclException
from
- The starting index.to
- The ending index (inclusive).objv
- Array of objects to concatenate.
TclException
public static final boolean stringMatch(String str, String pat)
str
- String to compare pattern againstpat
- Pattern which may contain special characters.
public static String toTitle(String str)
str
- String to convert.
public static final boolean regExpMatch(Interp interp, String string, TclObject pattern) throws TclException
interp
- Current interpreterstring
- The string to match.pattern
- The regular expression.
TclException
public static final void appendElement(Interp interp, StringBuffer sbuf, String s) throws TclException
interp
- Current interpreter.sbuf
- The buffer to append to.s
- The string to append.
TclException
public static String TrimLeft(String str, String pattern)
str
- The string to trimpattern
- The pattern string used to trim.
public static String TrimLeft(String str)
str
- The string to trim.
public static String TrimRight(String str, String pattern)
str
- The string to trim.pattern
- The pattern to trim.
public static String TrimRight(String str)
public static boolean getBoolean(Interp interp, String string) throws TclException
interp
- The current interpreter.string
- The string representation of the boolean.
TclException
- For malformed boolean values.public static final boolean isUnix()
public static final boolean isMac()
public static final boolean isWindows()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |