class List

Native list type. More...

Full nameKJS::List
Definition#include <types.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Public Members


Detailed Description

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:
objPointer to object.

void  prepend (const KJSO& obj)

prepend

Insert an object at the beginning of the list.

Parameters:
objPointer 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:
iList 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 kde.faure.org on Thu Jan 17 22:18:54 2002, using kdoc 2.0a53.