Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (41 sloc) 0.678 kb
61fcbf9e »
2011-10-25 Initial commit
1 package lists
2 {
3 import lists.nodes.ListNodeBase;
4 public class DataExtendsNodeList
5 {
6 public var head : ListNodeBase;
7 public var tail : ListNodeBase;
8
9 public function add( node : ListNodeBase ) : void
10 {
11 if( ! head )
12 {
13 head = tail = node;
14 }
15 else
16 {
17 tail.next = node;
18 node.previous = tail;
19 tail = node;
20 }
21 }
22
23 public function remove( node : ListNodeBase ) : void
24 {
25 if ( head == node)
26 {
27 head = head.next;
28 }
29 if ( tail == node)
30 {
31 tail = tail.previous;
32 }
33
34 if (node.previous)
35 {
36 node.previous.next = node.next;
37 }
38
39 if (node.next)
40 {
41 node.next.previous = node.previous;
42 }
43 }
44 }
45 }
Something went wrong with that request. Please try again.