Main Page Modules Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members Related Pages
KJS::List Class Reference
Native list type.
More...
#include <types.h>
Inheritance diagram for KJS::List:
List of all members.
Detailed Description
Native list type.
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.
Definition at line 132 of file types.h.
Member Function Documentation
| void KJS::List::append |
( |
const Value & |
val |
) |
|
|
|
|
Append an object to the end of the list. - Parameters:
-
|
| void KJS::List::appendList |
( |
const List & |
lst |
) |
|
|
|
|
Appends the items of another list at the end of this one. |
| Value KJS::List::at |
( |
int |
i |
) |
const |
|
|
|
Retrieve an element at an indexed position. If you want to iterate trough the whole list using KJS::ListIterator will be faster. - Parameters:
-
- Returns:
-
Return the element at position i. KJS::Undefined if the index is out of range.
|
| void KJS::List::clear |
( |
|
) |
|
|
|
|
Remove all elements from the list. |
|
|
Returns a deep copy of the list. Ownership is passed to the user who is responsible for deleting the list then. |
| List KJS::List::dynamicCast |
( |
const Value & |
v |
) |
[static] |
|
|
|
Converts a Value into an List. If the value's type is not ListType, a null object will be returned (i.e. one with it's internal pointer set to 0). If you do not know for sure whether the value is of type List, you should check the isNull() methods afterwards before calling any methods on the returned value.
- Returns:
-
The value converted to an List
|
| const List KJS::List::empty |
( |
|
) |
[static] |
|
|
|
Returns a pointer to a static instance of an empty list. Useful if a function has a List parameter. |
| bool KJS::List::isEmpty |
( |
|
) |
|
|
|
|
- Returns:
-
true if the list is empty. false otherwise.
|
| Value KJS::List::operator[] |
( |
int |
i |
) |
const |
|
| void KJS::List::prepend |
( |
const Value & |
val |
) |
|
|
|
|
Insert an object at the beginning of the list. - Parameters:
-
|
| void KJS::List::prependList |
( |
const List & |
lst |
) |
|
|
|
|
Prepend the items of another list to this one. The first item of lst will become the first item of the list. |
| void KJS::List::removeFirst |
( |
|
) |
|
|
|
|
Remove the element at the beginning of the list. |
| void KJS::List::removeLast |
( |
|
) |
|
|
|
|
Remove the element at the end of the list. |
|
|
- Returns:
-
the current size of the list.
|
The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:34 2003 for kdelibs by
1.2.18