|
|
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 list is explicitly shared. Note that while copy() returns a deep copy of the list the referenced objects are still shared.
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 remove (const KJSO &obj)
| remove |
void clear ()
| clear |
Remove all elements from the list.
List * copy ()
| copy |
[const]
Returns a deep copy of the list. Ownership is passed to the user who is responsible for deleting the list then.
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: faure@ftp.kde.com on Wed Feb 28 07:17:11 2001, using kdoc 2.0a50. |