GODPAPER | All Packages | All Classes | Index | Frames No Frames |
SlotList

Package | org.osflash.signals
Class | public final class SlotList
Inheritance | SlotList Object

The SlotList class represents an immutable list of Slot objects.

Public Properties

| Property | Defined By
--- | --- | ---
|  | head : ISlot | SlotList
|  | length : uint [read-only] The number of slots in the list. | SlotList
|  | nonEmpty : Boolean = false | SlotList
|  | tail : SlotList | SlotList

Public Methods

| Method | Defined By
--- | --- | ---
|  | SlotList(head:ISlot, tail:SlotList = null) Creates and returns a new SlotList object. | SlotList
|  | append(slot:ISlot):SlotList Appends a slot to this list. | SlotList
|  | contains(listener:Function):Boolean Determines whether the supplied listener Function is contained within this list | SlotList
|  | filterNot(listener:Function):SlotList Returns the slots in this list that do not contain the supplied listener. | SlotList
|  | find(listener:Function):ISlot Retrieves the ISlot associated with a supplied listener within the SlotList. | SlotList
|  | insertWithPriority(slot:ISlot):SlotList Insert a slot into the list in a position according to its priority. | SlotList
|  | prepend(slot:ISlot):SlotList Prepends a slot to this list. | SlotList
|  | toString():String | SlotList

Public Constants

| Constant | Defined By
--- | --- | ---
|  | NIL : SlotList [static] Represents an empty list. | SlotList

Property Detail

head | property

`public var head:ISlot`

length | property |

`length:uint` [read-only]

The number of slots in the list.

Implementation
`public function get length():uint`

nonEmpty | property |

`public var nonEmpty:Boolean = false`

tail | property |

`public var tail:SlotList`

Constructor Detail

SlotList | () | Constructor

`public function SlotList(head:ISlot, tail:SlotList = null)`

Creates and returns a new SlotList object.

A user never has to create a SlotList manually. Use the `NIL` element to represent an empty list. `NIL.prepend(value)` would create a list containing `value`

. Parameters

| `head:ISlot` — The first slot in the list.
| `tail:SlotList` (default = `null`)`` — A list containing all slots except head.

Throws

| `ArgumentError` — `ArgumentError`: Parameters head and tail are null. Use the NIL element instead.
| `ArgumentError` — `ArgumentError`: Parameter head cannot be null.

Method Detail

append | () | method

`public function append(slot:ISlot):SlotList`

Appends a slot to this list. Note: appending is O(n). Where possible, prepend which is O(1). In some cases, many list items must be cloned to avoid changing existing lists.

Parameters

| `slot:ISlot` — The item to be appended.

Returns

| `SlotList` — A list consisting of all elements of this list followed by slot.

contains | () | method |

`public function contains(listener:Function):Boolean`

Determines whether the supplied listener Function is contained within this list

Parameters

| `listener:Function`

Returns

| `Boolean`

filterNot | () | method |

`public function filterNot(listener:Function):SlotList`

Returns the slots in this list that do not contain the supplied listener. Note: assumes the listener is not repeated within the list.

Parameters

| `listener:Function` — The function to remove.

Returns

| `SlotList` — A list consisting of all elements of this list that do not have listener.

find | () | method |

`public function find(listener:Function):ISlot`

Retrieves the ISlot associated with a supplied listener within the SlotList.

Parameters

| `listener:Function` — The Function being searched for

Returns

| `ISlot` — The ISlot in this list associated with the listener parameter through the ISlot.listener property. Returns null if no such ISlot instance exists or the list is empty.

insertWithPriority | () | method |

`public function insertWithPriority(slot:ISlot):SlotList`

Insert a slot into the list in a position according to its priority. The higher the priority, the closer the item will be inserted to the list head.

Parameters

| `slot:ISlot`

Returns

| `SlotList`

Throws

| `ArgumentError` — `ArgumentError`: Parameters head and tail are null. Use the NIL element instead.
| `ArgumentError` — `ArgumentError`: Parameter head cannot be null.

prepend | () | method |

`public function prepend(slot:ISlot):SlotList`

Prepends a slot to this list.

Parameters

| `slot:ISlot` — The item to be prepended.

Returns

| `SlotList` — A list consisting of slot followed by all elements of this list.

Throws

| `ArgumentError` — `ArgumentError`: Parameter head cannot be null.

toString | () | method |

`public function toString():String`

Returns

| `String`

Constant Detail

NIL | Constant

`public static const NIL:SlotList`

Represents an empty list. Used as the list terminator.

Thu Jan 16 2014, 01:11 PM +08:00