|
|
List is a native ECMAScript type. List values are only used for intermediate results of expression evaluation and cannot be stored as properties of objects.
The class takes care of memory management via reference counting.
List ()
| List |
Constructor.
~List ()
| ~List |
Destructor.
void append (const KJSO& obj)
| append |
Append an object to the end of the list.
Parameters:
obj | Pointer to object. |
void prepend (const KJSO& obj)
| prepend |
Insert an object at the beginning of the list.
Parameters:
obj | Pointer to object. |
void removeFirst ()
| removeFirst |
Remove the element at the beginning of the list.
void removeLast ()
| removeLast |
Remove the element at the end of the list.
void clear ()
| clear |
Remove all elements from the list.
ListIterator begin ()
| begin |
[const]
Returns: A KJS::ListIterator pointing to the first element.
ListIterator end ()
| end |
[const]
Returns: A KJS::ListIterator pointing to the last element.
bool isEmpty ()
| isEmpty |
[const]
Returns: true if the list is empty. false otherwise.
int size ()
| size |
[const]
Returns: the current size of the list.
KJSO at (int i)
| at |
[const]
Retrieve an element at an indexed position. If you want to iterate trough the whole list using KJS::ListIterator will be faster.
Parameters:
i | List index. |
Returns: Return the element at position i. KJS::Undefined if the index is out of range.
KJSO operator[] (int i)
| operator[] |
[const]
Equivalent to at.
const List * empty ()
| empty |
[static]
Returns a pointer to a static instance of an empty list. Useful if a function has a KJS::List parameter.
static int count | count |
Generated by: dfaure on Tue Feb 27 12:47:36 2001, using kdoc 2.0a50. |