Packagemx.utils
Classpublic class LinkedList
InheritanceLinkedList Inheritance Object

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Provides a generic doubly linked list implementation.



Public Properties
 PropertyDefined By
  head : LinkedListNode
[read-only] Node representing head of the list.
LinkedList
  length : Number
[read-only] Returns length of list.
LinkedList
  tail : LinkedListNode
[read-only] Node representing tail of the list.
LinkedList
Public Methods
 MethodDefined By
  
Constructor.
LinkedList
  
Searches through all nodes for the given value.
LinkedList
  
Inserts new node after a previously existing node.
LinkedList
  
Inserts new node before a previously existing node.
LinkedList
  
Removes the node at the tail of the list.
LinkedList
  
Push a new node to the tail of list.
LinkedList
  
Searches through all nodes for the given value and removes it from the list if found.
LinkedList
  
Removes the node at the head of the list.
LinkedList
  
Push a new node to the head of list.
LinkedList
Property Detail
headproperty
head:LinkedListNode  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Node representing head of the list.


Implementation
    public function get head():LinkedListNode
lengthproperty 
length:Number  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Returns length of list.


Implementation
    public function get length():Number
tailproperty 
tail:LinkedListNode  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Node representing tail of the list.


Implementation
    public function get tail():LinkedListNode
Constructor Detail
LinkedList()Constructor
public function LinkedList()

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Constructor.

Method Detail
find()method
public function find(value:*):LinkedListNode

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Searches through all nodes for the given value.

Parameters

value:* — The value to find.

Returns
LinkedListNode — The node location.
insertAfter()method 
public function insertAfter(value:*, prev:LinkedListNode):LinkedListNode

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Inserts new node after a previously existing node.

Parameters

value:* — Value to insert. If the value is not a LinkedListNode one will be created.
 
prev:LinkedListNode — The previous node to insert relative to.

Returns
LinkedListNode — The new node.
insertBefore()method 
public function insertBefore(value:*, next:LinkedListNode):LinkedListNode

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Inserts new node before a previously existing node.

Parameters

value:* — Value to insert. If the value is not a LinkedListNode one will be created.
 
next:LinkedListNode — The node to insert relative to.

Returns
LinkedListNode — The new node.
pop()method 
public function pop():LinkedListNode

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Removes the node at the tail of the list.

Returns
LinkedListNode — The removed node.
push()method 
public function push(value:*):LinkedListNode

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Push a new node to the tail of list.

Parameters

value:* — The value to append.

Returns
LinkedListNode — The newly appended node.
remove()method 
public function remove(value:*):LinkedListNode

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Searches through all nodes for the given value and removes it from the list if found.

Parameters

value:* — The value to find and remove.

Returns
LinkedListNode — The removed node, null otherwise.
shift()method 
public function shift():LinkedListNode

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Removes the node at the head of the list.

Returns
LinkedListNode — The removed node.
unshift()method 
public function unshift(value:*):LinkedListNode

Language Version : ActionScript 3.0
Product Version : Flex 4.5
Runtime Versions : Flash Player 10, AIR 1.5

Push a new node to the head of list.

Parameters

value:* — The value to append.

Returns
LinkedListNode — The newly appended node.