back to index
ListNode
- derived from the Value class
- a node or header of a double linked list
- can be accessed in custom C++ extensions
- the {} list expression is used to create new double-linked lists of Value objects on-the-fly
- the List class can be used to handle ListNodes
- Also see here and here
Inheritance
Object -> Value -> ListNode
Properties
head - - return head of list (which has no parent)
tail - - return tail of list (which has no successor)
prev - - return previous ListNode
next - - return next ListNode
copy - - return a copy of the list started by this node (reference objects)
Methods
<var> operator [] (int _index) - get the value of listnode #_index
ListNode operator + (ListNode _l) - concat this list and _l (reference objects)
ListNode operator + (Value _v) - concat this list and _v (reference object)
ListNode operator ^ (ListNode _l) - concat this list and _l (grab objects)
ListNode operator ^ (Value _v) - concat this list and _v (grab object)
ListNode append () - append/insert a list node right next to this node (previous next becomes next of new node)
ListNode appendValue (Value _v) - append a new node and set value, e.g. l.appendValue(#(PI));
ListNode copy () - return a copy of this list. Object members will be referenced, not copied.
String getDebugString () - return string for debugging purposes (just this node)
String getDebugStrings () - return string for debugging purposes (entire list)
ListNode getHead () - return first ListNode
ListNode getNext () - return next ListNode (or null)
ListNode getPrev () - return previous ListNode (or null)
String getString () - return string, e.g. "{1,2,3}"
ListNode getSubList (int _idx) - return (reference to) sub list starting at index _idx
ListNode getTail () - return last ListNode
setValue (Value _v) - assign value to this value (typecast if necessary). grab objects.
<Value methods>
Examples
Value v;
foreach v in {1,2.3,"hello, world",{1,2,3}}
trace "v.type="+v.type+" v.value="+v.value;
list.tks
tgclso_lists.tks
back to index