|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.ac.man.cs.rainbow.Utils
Basic utility methods for Rainbow.
Method Summary | |
static String |
compoundList(String start,
String sep,
String end,
Object[] items)
Concatenate list of objects with a separator and bracketing strings. |
static String |
compoundList(String start,
String sep,
String end,
Object[] items1,
String sep2,
Object[] items2)
Concatenate-merge two lists of objects with separators and bracketing strings. |
static void |
DEBUG(String msg)
Print a debugging string. |
static Hashtable |
makeHash(String[] strings)
Convert an array of strings into a hashtable. |
static Hashtable |
makeHashInt(String[] strings)
Convert an array of strings into a hashtable. |
static String |
makeTclLine(String s)
Make a Tcl-formatted line from a string. |
static String |
makeTclLine(String[] strings)
Make a Tcl-formatted line from a list of strings. |
static String |
readTclLine(BufferedReader reader)
Read a complete Tcl-formatted line. |
static String[] |
splitTclLine(String line)
Split a Tcl-formatted line up into words. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final String compoundList(String start, String sep, String end, Object[] items)
start
- Leading string.sep
- Separating string.end
- Terminating string.items
- Array of objects to print prettily.public static final String compoundList(String start, String sep, String end, Object[] items1, String sep2, Object[] items2)
start
- Leading string.sep
- Separating string.end
- Terminating string.items1
- First array of objects to print prettily.sep2
- Second separating string (between items1i and
items2i)items2
- Second array of objects to print prettily.public static String readTclLine(BufferedReader reader) throws IOException, TclFormatException
reader
- The data source to read the line from.IOException
- When something goes wrong with the data source.TclFormatException
- When there isn't a well-formatted Tcl line on the data source.public static String[] splitTclLine(String line) throws TclFormatException
line
- The line to split.TclFormatException
- If the line isn't a Tcl-formatted list of words, or if it contains
an unsupported escape sequence.readTclLine(BufferedReader)
public static String makeTclLine(String s)
s
- The string to convert to a Tcl-formatted line.makeTclLine(String[])
public static String makeTclLine(String[] strings)
strings
- The array of strings to convert to a Tcl-formatted line.makeTclLine(String)
public static Hashtable makeHash(String[] strings) throws RainbowException
strings
- Array of keys and values.RainbowException
- If there are an odd number of input strings.makeHashInt(String[])
public static Hashtable makeHashInt(String[] strings) throws RainbowException, NumberFormatException
Integer
.strings
- Array of keys and values.RainbowException
- If there are an odd number of input strings.NumberFormatException
- If any of the values are not valid base-10 integers.makeHash(String[])
public static void DEBUG(String msg)
msg
- String to print.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |