jsky.util
Class TclUtil

java.lang.Object
  extended by jsky.util.TclUtil

public class TclUtil
extends java.lang.Object

Utility class for dealing with Tcl style lists and evaluating Tcl style expressions.

Note that this class was previously based on Jacl/TclJava, but was rewritten to improve performance. This version is more simple minded than the Tcl version.


Constructor Summary
TclUtil()
           
 
Method Summary
static void main(java.lang.String[] args)
          test main
static java.lang.String makeList(java.lang.Object[] ar)
          Convert the given array of Objects to a Tcl list formatted string and return the result.
static java.lang.String makeList(java.lang.String[] ar)
          Convert the given array of strings to a Tcl list formatted string and return the result.
static java.lang.String[] splitList(java.lang.String tclList)
          Split a Tcl style list into an array of strings and return the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TclUtil

public TclUtil()
Method Detail

splitList

public static java.lang.String[] splitList(java.lang.String tclList)
Split a Tcl style list into an array of strings and return the result.

Parameters:
tclList - a String in Tcl list format.
Returns:
an array of Strings, one element for each Tcl list item

makeList

public static java.lang.String makeList(java.lang.String[] ar)
Convert the given array of strings to a Tcl list formatted string and return the result.

Parameters:
ar - an array of Strings, one element for each Tcl list item
Returns:
a String in Tcl list format.

makeList

public static java.lang.String makeList(java.lang.Object[] ar)
Convert the given array of Objects to a Tcl list formatted string and return the result.

Parameters:
ar - an array of Objects, one element for each Tcl list item
Returns:
a String in Tcl list format.

main

public static void main(java.lang.String[] args)
test main