| java.lang.Object tcl.lang.TclList
TclList | public class TclList implements InternalRep(Code) | | This class implements the list object type in Tcl.
|
Method Summary | |
final public static void | append(Interp interp, TclObject tobj, TclObject elemObj) Tcl_ListObjAppendElement -> TclList.append()
Appends a TclObject element to a list object. | final static void | append(Interp interp, TclObject tobj, TclObject[] objv, int startIdx, int endIdx) TclList.append()
Appends multiple TclObject elements to a list object. | public void | dispose() Called to free any storage for the type's internal rep. | public InternalRep | duplicate() DupListInternalRep -> duplicate
Returns a dupilcate of the current object. | public static TclObject[] | getElements(Interp interp, TclObject tobj) Returns a TclObject array of the elements in a list object. | final public static int | getLength(Interp interp, TclObject tobj) Queries the length of the list. | final public static TclObject | index(Interp interp, TclObject tobj, int index) This procedure returns a pointer to the index'th object from
the list referenced by tobj. | final static void | insert(Interp interp, TclObject tobj, int index, TclObject elements, int from, int to) This procedure inserts the elements in elements[] into the list at
the given index. | public static TclObject | newInstance() Creates a new instance of a TclObject with a TclList internal
rep. | final public static void | replace(Interp interp, TclObject tobj, int index, int count, TclObject elements, int from, int to) This procedure replaces zero or more elements of the list
referenced by tobj with the objects from an TclObject array.
If tobj is not a list object, an attempt will be made to
convert it to a list.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to use as a list. Parameters: index - the starting index of the replace operation. | static void | sort(Interp interp, TclObject tobj, int sortMode, int sortIndex, boolean sortIncreasing, String command) Sorts the list according to the sort mode and (optional) sort command. | public String | toString() Called to query the string representation of the Tcl object. |
append | final public static void append(Interp interp, TclObject tobj, TclObject elemObj) throws TclException(Code) | | Tcl_ListObjAppendElement -> TclList.append()
Appends a TclObject element to a list object.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to append an element to. Parameters: elemObj - the element to append to the object. exception: TclException - if tobj cannot be converted into a list. |
append | final static void append(Interp interp, TclObject tobj, TclObject[] objv, int startIdx, int endIdx) throws TclException(Code) | | TclList.append()
Appends multiple TclObject elements to a list object.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to append elements to. Parameters: objv - array containing elements to append. Parameters: startIdx - index to start appending values from Parameters: endIdx - index to stop appending values at exception: TclException - if tobj cannot be converted into a list. |
dispose | public void dispose()(Code) | | Called to free any storage for the type's internal rep.
|
duplicate | public InternalRep duplicate()(Code) | | DupListInternalRep -> duplicate
Returns a dupilcate of the current object.
|
getElements | public static TclObject[] getElements(Interp interp, TclObject tobj) throws TclException(Code) | | Returns a TclObject array of the elements in a list object. If
tobj is not a list object, an attempt will be made to convert
it to a list.
The objects referenced by the returned array should be treated
as readonly and their ref counts are _not_ incremented; the
caller must do that if it holds on to a reference.
Parameters: interp - the current interpreter. Parameters: tobj - the list to sort. a TclObject array of the elements in a list object. exception: TclException - if tobj is not a valid list. |
getLength | final public static int getLength(Interp interp, TclObject tobj) throws TclException(Code) | | Queries the length of the list. If tobj is not a list object,
an attempt will be made to convert it to a list.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to use as a list. the length of the list. exception: TclException - if tobj is not a valid list. |
index | final public static TclObject index(Interp interp, TclObject tobj, int index) throws TclException(Code) | | This procedure returns a pointer to the index'th object from
the list referenced by tobj. The first element has index
0. If index is negative or greater than or equal to the number
of elements in the list, a null is returned. If tobj is not a
list object, an attempt will be made to convert it to a list.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to use as a list. Parameters: index - the index of the requested element. the the requested element. exception: TclException - if tobj is not a valid list. |
insert | final static void insert(Interp interp, TclObject tobj, int index, TclObject elements, int from, int to) throws TclException(Code) | | This procedure inserts the elements in elements[] into the list at
the given index. If tobj is not a list object, an attempt will
be made to convert it to a list.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to use as a list. Parameters: index - the starting index of the insertion operation. <=0 meansthe beginning of the list. >= TclList.getLength(tobj) meansthe end of the list. Parameters: elements - the element(s) to insert. Parameters: from - insert elements starting from elements[from] (inclusive) Parameters: to - insert elements up to elements[to] (inclusive) exception: TclException - if tobj is not a valid list. |
newInstance | public static TclObject newInstance()(Code) | | Creates a new instance of a TclObject with a TclList internal
rep.
the TclObject with the given list value. |
replace | final public static void replace(Interp interp, TclObject tobj, int index, int count, TclObject elements, int from, int to) throws TclException(Code) | | This procedure replaces zero or more elements of the list
referenced by tobj with the objects from an TclObject array.
If tobj is not a list object, an attempt will be made to
convert it to a list.
Parameters: interp - current interpreter. Parameters: tobj - the TclObject to use as a list. Parameters: index - the starting index of the replace operation. <=0 meansthe beginning of the list. >= TclList.getLength(tobj) meansthe end of the list. Parameters: count - the number of elements to delete from the list. <=0 meansno elements should be deleted and the operation is equivalent toan insertion operation. Parameters: elements - the element(s) to insert. Parameters: from - insert elements starting from elements[from] (inclusive) Parameters: to - insert elements up to elements[to] (inclusive) exception: TclException - if tobj is not a valid list. |
sort | static void sort(Interp interp, TclObject tobj, int sortMode, int sortIndex, boolean sortIncreasing, String command) throws TclException(Code) | | Sorts the list according to the sort mode and (optional) sort command.
If tobj is not a list object, an attempt will be made to
convert it to a list.
Parameters: interp - the current interpreter. Parameters: tobj - the list to sort. Parameters: sortMode - the sorting mode. Parameters: sortIncreasing - true if to sort the elements in increasing order. Parameters: command - the command to compute the order of two elements. exception: TclException - if tobj is not a valid list. |
toString | public String toString()(Code) | | Called to query the string representation of the Tcl object. This
method is called only by TclObject.toString() when
TclObject.stringRep is null.
the string representation of the Tcl object. |
|
|