tcl.lang
Class TclString

java.lang.Object
  extended by tcl.lang.TclString
All Implemented Interfaces:
InternalRep

public class TclString
extends java.lang.Object
implements InternalRep


Method Summary
static void append(TclObject tobj, char[] charArr, int offset, int length)
          Appends an array of characters to a TclObject Object.
static void append(TclObject tobj, java.lang.String string)
          Appends a string to a TclObject object.
 void dispose()
          Implement this no-op for the InternalRep interface.
 InternalRep duplicate()
          Returns a dupilcate of the current object.
static void empty(TclObject tobj)
          This procedure clears out an existing TclObject so that it has a string representation of "".
static TclObject newInstance(java.lang.String str)
          Create a new TclObject that has a string representation with the given string value.
static TclObject newInstance(java.lang.StringBuffer sb)
          Create a new TclObject that makes use of the given StringBuffer object.
 java.lang.String toString()
          Called to query the string representation of the Tcl object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

duplicate

public InternalRep duplicate()
Returns a dupilcate of the current object.

Specified by:
duplicate in interface InternalRep
Parameters:
obj - the TclObject that contains this internalRep.

dispose

public void dispose()
Implement this no-op for the InternalRep interface.

Specified by:
dispose in interface InternalRep

toString

public java.lang.String toString()
Called to query the string representation of the Tcl object. This method is called only by TclObject.toString() when TclObject.stringRep is null.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of the Tcl object.

newInstance

public static TclObject newInstance(java.lang.String str)
Create a new TclObject that has a string representation with the given string value.


newInstance

public static TclObject newInstance(java.lang.StringBuffer sb)
Create a new TclObject that makes use of the given StringBuffer object. The passed in StringBuffer should not be modified after it is passed to this method.


append

public static final void append(TclObject tobj,
                                java.lang.String string)
Appends a string to a TclObject object. This method is equivalent to Tcl_AppendToObj() in Tcl 8.0.

Parameters:
tobj - the TclObject to append a string to.
string - the string to append to the object.

append

public static final void append(TclObject tobj,
                                char[] charArr,
                                int offset,
                                int length)
Appends an array of characters to a TclObject Object. Tcl_AppendUnicodeToObj() in Tcl 8.0.

Parameters:
tobj - the TclObject to append a string to.
charArr - array of characters.
offset - index of first character to append.
length - number of characters to append.

empty

public static void empty(TclObject tobj)
This procedure clears out an existing TclObject so that it has a string representation of "". This method is used only in the IO layer.