|
||||||||||
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 String |
checkBadOctal(Interp interp,
String value)
|
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 void |
convertElement(String s,
int flags,
StringBuffer sbuf)
Tcl_ConvertElement -> convertElement This is a companion procedure to scanElement. |
static boolean |
findElement(Interp interp,
String s,
int i,
int len,
tcl.lang.FindElemResult fer)
findElement -- Given a String that contains a Tcl list, locate the first (or next) element in the list. |
static int |
getActualPlatform()
getActualPlatform -- This static procedure returns the integer code for the actual platform on which Jacl is running. |
static boolean |
getBoolean(Interp interp,
String string)
getBoolean -- Given a string, return a boolean value corresponding to the string. |
static double |
getDouble(Interp interp,
String s)
getDouble -- Converts an ASCII string to a double. |
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 long |
getWideInt(Interp interp,
String str)
Converts an ASCII string to a wide integer. |
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 |
looksLikeInt(String s)
looksLikeInt -- Returns true when isJacl() is true and this string looks like an integer. |
static String |
printDouble(double number)
printDouble -- Returns the string form of a double number. |
static boolean |
regExpMatch(Interp interp,
String string,
TclObject pattern)
regExpMatch -- See if a string matches a regular expression. |
static int |
scanElement(Interp interp,
String string)
Tcl_ScanElement -> scanElement This procedure is a companion procedure to convertElement. |
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 long getWideInt(Interp interp, String str) throws TclException
interp
- str
-
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 final String checkBadOctal(Interp interp, String value)
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 double getDouble(Interp interp, String s) throws TclException
interp
- The current interpreter, can be nulls
- The string to convert from. Must be in valid Tcl double
format.
TclException
public 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 final boolean findElement(Interp interp, String s, int i, int len, tcl.lang.FindElemResult fer) throws TclException
interp
- Current interpreter, can be null.s
- The string to locate an element.i
- The index inside s to start locating an element.len
- The length of the string.fer
- The result object to populate.
TclException
public static int scanElement(Interp interp, String string) throws TclException
interp
- The current interpreter.string
- The String to scan. (could be null)
TclException
public static void convertElement(String s, int flags, StringBuffer sbuf)
s
- Source information for list element.flags
- Flags produced by scanElementsbuf
- Buffer to write element topublic 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 int getActualPlatform()
public static final boolean isUnix()
public static final boolean isMac()
public static final boolean isWindows()
public static boolean looksLikeInt(String s)
s
- String to check
public static String printDouble(double number)
number
- The number to format into a string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |