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

Package | org.osflash.signals
Interface | public interface IOnceSignal
Implementors | OnceSignal

Public Properties

| Property | Defined By
--- | --- | ---
|  | numListeners : uint [read-only] The current number of listeners for the signal. | IOnceSignal
|  | valueClasses : Array An optional array of classes defining the types of parameters sent to listeners. | IOnceSignal

Public Methods

| Method | Defined By
--- | --- | ---
|  | addOnce(listener:Function):ISlot Subscribes a one-time listener for this signal. | IOnceSignal
|  | dispatch(... valueObjects):void Dispatches an object to listeners. | IOnceSignal
|  | remove(listener:Function):ISlot Unsubscribes a listener from the signal. | IOnceSignal
|  | removeAll():void Unsubscribes all listeners from the signal. | IOnceSignal

Property Detail

numListeners | property

`numListeners:uint` [read-only]

The current number of listeners for the signal.

Implementation
`public function get numListeners():uint`

valueClasses | property |

`valueClasses:Array`

An optional array of classes defining the types of parameters sent to listeners.

Implementation
`public function get valueClasses():Array`
`public function set valueClasses(value:Array):void`
Method Detail

addOnce | () | method

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

Subscribes a one-time listener for this signal. The signal will remove the listener automatically the first time it is called, after the dispatch to all listeners is complete.

Parameters

| `listener:Function` — A function with arguments that matches the value classes dispatched by the signal. If value classes are not specified (e.g. via Signal constructor), dispatch() can be called without arguments.

Returns

| `ISlot` — a ISlot, which contains the Function passed as the parameter

dispatch | () | method |

`public function dispatch(... valueObjects):void`

Dispatches an object to listeners.

Parameters

| `... valueObjects` — Any number of parameters to send to listeners. Will be type-checked against valueClasses.

Throws

| `ArgumentError `ArgumentError`: valueObjects` — are not compatible with valueClasses.

remove | () | method |

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

Unsubscribes a listener from the signal.

Parameters

| `listener:Function`

Returns

| `ISlot` — a ISlot, which contains the Function passed as the parameter

removeAll | () | method |

`public function removeAll():void`

Unsubscribes all listeners from the signal.

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