| Package | org.osflash.signals |
| Class | public class Slot |
| Inheritance | Slot Object |
| Implements | ISlot |
| Property | Defined By | ||
|---|---|---|---|
| enabled : Boolean
Whether the listener is called on execution. | Slot | ||
| listener : Function
The listener associated with this slot. | Slot | ||
| once : Boolean [read-only]
Whether this slot is automatically removed after it has been used once. | Slot | ||
| params : Array
Allows the ISlot to inject parameters when dispatching. | Slot | ||
| priority : int [read-only]
The priority of this slot should be given in the execution order. | Slot | ||
| Property | Defined By | ||
|---|---|---|---|
| _enabled : Boolean = true | Slot | ||
| _listener : Function | Slot | ||
| _once : Boolean = false | Slot | ||
| _params : Array | Slot | ||
| _priority : int = 0 | Slot | ||
| _signal : IOnceSignal | Slot | ||
| Method | Defined By | ||
|---|---|---|---|
Slot(listener:Function, signal:IOnceSignal, once:Boolean = false, priority:int = 0)
Creates and returns a new Slot object. | Slot | ||
execute(valueObjects:Array):void
Executes a listener of arity n where n is
valueObjects.length. | Slot | ||
execute0():void
Executes a listener without arguments. | Slot | ||
execute1(value:Object):void
Dispatches one argument to a listener. | Slot | ||
remove():void
Removes the slot from its signal. | Slot | ||
toString():String
Creates and returns the string representation of the current object. | Slot | ||
| Method | Defined By | ||
|---|---|---|---|
verifyListener(listener:Function):void | Slot | ||
| _enabled | property |
protected var _enabled:Boolean = true| _listener | property |
protected var _listener:Function| _once | property |
protected var _once:Boolean = false| _params | property |
protected var _params:Array| _priority | property |
protected var _priority:int = 0| _signal | property |
protected var _signal:IOnceSignal| enabled | property |
enabled:BooleanWhether the listener is called on execution. Defaults to true.
public function get enabled():Boolean public function set enabled(value:Boolean):void| listener | property |
listener:FunctionThe listener associated with this slot.
public function get listener():Function public function set listener(value:Function):voidArgumentError — ArgumentError: Given listener is null. Did you want to set enabled to false instead?
| |
Error — Error: Internal signal reference has not been set yet.
|
| once | property |
once:Boolean [read-only] Whether this slot is automatically removed after it has been used once.
public function get once():Boolean| params | property |
params:ArrayAllows the ISlot to inject parameters when dispatching. The params will be at the tail of the arguments and the ISignal arguments will be at the head. var signal:ISignal = new Signal(String); signal.add(handler).params = [42]; signal.dispatch('The Answer'); function handler(name:String, num:int):void{}
public function get params():Array public function set params(value:Array):void| priority | property |
priority:int [read-only] The priority of this slot should be given in the execution order. An IPrioritySignal will call higher numbers before lower ones. Defaults to 0.
public function get priority():int| Slot | () | Constructor |
public function Slot(listener:Function, signal:IOnceSignal, once:Boolean = false, priority:int = 0)Creates and returns a new Slot object.
Parameterslistener:Function — The listener associated with the slot.
| |
signal:IOnceSignal — The signal associated with the slot.
| |
once:Boolean (default = false) — Whether or not the listener should be executed only once.
| |
priority:int (default = 0) — The priority of the slot.
|
ArgumentError — ArgumentError: Given listener is null.
| |
Error — Error: Internal signal reference has not been set yet.
|
| execute | () | method |
public function execute(valueObjects:Array):void
Executes a listener of arity n where n is
valueObjects.length.
Existing params are appended before the listener is called.
Parameters
valueObjects:Array — The array of arguments to be applied to the listener.
|
| execute0 | () | method |
public function execute0():void
Executes a listener without arguments.
Existing params are appended before the listener is called.
| execute1 | () | method |
public function execute1(value:Object):void
Dispatches one argument to a listener.
Existing params are appended before the listener is called.
Parameters
value:Object — The argument for the listener.
|
| remove | () | method |
public function remove():voidRemoves the slot from its signal.
| toString | () | method |
public function toString():StringCreates and returns the string representation of the current object.
ReturnsString — The string representation of the current object.
|
| verifyListener | () | method |
protected function verifyListener(listener:Function):voidParameters
listener:Function |