A linked list implementation of the Collection interface. Each item added to a LinkedList is wrapped within a LinkedListItem object. This allows each item to maintain a reference to the previous and next items within the list. A LinkedList is similar to a chain in which each link is connected to both the previous and next links with the exception of the first link which does not have a previous and the last link that does not have a next.
asdk.LinkedList
class
Method | Description |
addAll( object ) |
Adds all the elements within the array or collection object to the end of the LinkedList. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
addFirst( object ) |
Adds the specified object to the head of the LinkedList. |
addItem( item ) |
Adds the specified item to the end the LinkedList. |
addLast( object ) |
Adds the specified object to the end of the LinkedList. |
clear() |
Removes all of the items from the LinkedList. |
containsItem( item ) |
A Boolean value indicating whether the specified item is stored in the LinkedList. |
containsAllItems( items : Collection ) |
A Boolean value indicating whether all the items within the specified Collection are stored in the LinkedList. |
dataIterator() |
Returns an iterator that can traverse the data within the LinkedList. |
getFirst() |
Gets the first item within the LinkedList. |
getItemAt( index : Number ) |
Gets the item within the LinkedList at the specified index. |
getIndexOfData( object ) |
Gets the index of the specified data object within the LinkedList. Returns -1 if the object is not found in the list. |
getLastIndexOfData( object ) |
Gets the last index of the specified data object within the LinkedList. Returns -1 if the object is not found in the list. |
getLast() |
Gets the last item within the LinkedList. |
getSize() |
Returns the total number of key/value pairs stored within the LinkedList |
isEmpty() |
A Boolean value indicating whether the LinkedList is empty (true) or not (false). |
iterator() |
Returns an iterator that can traverse the items (LinkedListItem objects) within the LinkedList. |
removeAllItems( items : Collection ) |
Removes all the items within the collection object from the LinkedList. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
removeFirst() |
Removes the first item from the LinkedList. |
removeItem( item ) |
Removes the specified item from the LinkedList. |
removeLast() |
Removes the last item from the LinkedList. |
retainAllItems( items : Collection ) |
Retains all the items within the collection object within the LinkedList and removes any items not in the collection. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
setComparator( condition ) |
Sets the comparator for the LinkedList; this allows for customizing how objects are compared by using various
implementations of the asdk.condition.IComparator interface. The default comparator is asdk.condition.ObjectComparator . |
toArray() |
Returns the items within the LinkedList as an array. |
toString() |
Returns a string representation of the LinkedList. |