back to index

List

Inheritance

Object -> List

Properties

head   - - return head of list (which has no predecessor)  
tail   - - return tail of list (which has no successor)  
copy   - - return a copy of the list started by this node (reference objects) 
string - - return string representation of list ("{1,2,3}" format)

Methods

<var>    operator []      (int _index)   - get the value of listnode #_index
         operator +       (List _l)      - concat this list and _l (reference objects)
         operator +       (ListNode _l)  - concat this list and _l (reference objects)
         operator ^       (List _l)      - concat this list and _l (grab objects)
         operator ^       (ListNode _l)  - concat this list and _l (grab objects)

ListNode addFirst         (Value _v)                       - insert new node before first node. Copy/grab value _v.
ListNode addFirstInt      (int _v)                         - insert new integer node before first node.
ListNode addFirstFloat    (float _v)                       - insert new float node before first node.
ListNode addFirstString   (String _v)                      - insert new String node before first node. Create a copy of _v.
ListNode addFirstObject   (Object _v)                      - insert new Object node before first node.
ListNode addFirstCopy     (Object _v)                      - insert new Object node before first node. Create a copy of _v.
ListNode addLast          (Value _v)                       - append new node after last node. Copy/grab value _v.
ListNode addLastInt       (int _v)                         - append new integer node after last node.
ListNode addLastFloat     (float _v)                       - append new float node after last node.
ListNode addLastString    (String _v)                      - append new String node after last node. Create a copy of _v.
ListNode addLastObject    (Object _v)                      - append new Object node after last node.
ListNode addLastCopy      (Object _v)                      - append new Object node after last node. Create a copy of _v.
ListNode findPointer      (Object _o)                      - find ListNode with objectVal==_o
List     getCopy          ()                               - create a copy of this list. reference objects. 
ListNode getHead          ()                               - return first ListNode 
int      getSize          ()                               - return number of nodes in list
String   getString        ()                               - same as head.string but tests if head==null
ListNode getSubList       (int _idx)                       - return (reference to) sub list starting at index _idx
ListNode getTail          ()                               - return last ListNode
ListNode insert           (Value|ListNode _v, ListNode _n) - insert _v after _n, return (first)new node
int      isEmpty          ()                               - returns true if list is empty. 
ListNode remove           (ListNode _l)                    - remove _l if exists and return read/write ListNode object
ListNode removeAll        ()                               - unlink ListNodes and return first node (volatile)
ListNode removeFirst      ()                               - unlink first ListNode and return it (volatile)
ListNode removeLast       ()                               - unlink last ListNode and return it (volatile)
         reverse          ()                               - reverse order of ListNodes

<ListNode methods>

Examples


back to index