class List<T>

A linked-list of elements. The list is composed of two-elements arrays that are chained together. It is optimized so that adding or removing an element does not imply copying the whole array content every time.

Instance Fields

var length:Int

The length of this List.

function new(): Void

Creates a new empty list.

function add(item:T): Void

Adds element item at the end of this List.

this.length increases by 1.

function pop(): Null<T>

Returns the first element of this List, or null if no elements exist.

The element is removed from this List.