ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
mx.utils 

LinkedList  - AS3 Flex

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
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  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
 Inherited
Indicates whether an object has a specified property defined.
Object
  
Inserts new node after a previously existing node.
LinkedList
  
Inserts new node before a previously existing node.
LinkedList
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
Removes the node at the tail of the list.
LinkedList
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
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
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Removes the node at the head of the list.
LinkedList
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
  
Push a new node to the head of list.
LinkedList
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail

head

property
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

length

property 
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

tail

property 
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.