Apache Flex 4.16.1 API Reference | All Packages | All Classes | Index | Frames No Frames |
LinkedList

Package | mx.utils
Class | public class LinkedList
Inheritance | LinkedList 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

| Property | Defined 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

| Method | Defined By
--- | --- | ---
|  | LinkedList() Constructor. | LinkedList
|  | find(value:*):LinkedListNode Searches through all nodes for the given value. | LinkedList
|  | insertAfter(value:*, prev:LinkedListNode):LinkedListNode Inserts new node after a previously existing node. | LinkedList
|  | insertBefore(value:*, next:LinkedListNode):LinkedListNode Inserts new node before a previously existing node. | LinkedList
|  | pop():LinkedListNode Removes the node at the tail of the list. | LinkedList
|  | push(value:*):LinkedListNode Push a new node to the tail of list. | LinkedList
|  | remove(value:*):LinkedListNode Searches through all nodes for the given value and removes it from the list if found. | LinkedList
|  | shift():LinkedListNode Removes the node at the head of the list. | LinkedList
|  | unshift(value:*):LinkedListNode Push a new node to the head of list. | LinkedList

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.

Wed Nov 15 2017, 09:50 AM +01:00