Packageorg.osflash.signals
Classpublic class Slot
InheritanceSlot Inheritance Object
Implements ISlot

The Slot class represents a signal slot.



Public Properties
 PropertyDefined 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
Protected Properties
 PropertyDefined By
  _enabled : Boolean = true
Slot
  _listener : Function
Slot
  _once : Boolean = false
Slot
  _params : Array
Slot
  _priority : int = 0
Slot
  _signal : IOnceSignal
Slot
Public Methods
 MethodDefined 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
Protected Methods
 MethodDefined By
  
verifyListener(listener:Function):void
Slot
Property Detail
_enabledproperty
protected var _enabled:Boolean = true

_listenerproperty 
protected var _listener:Function

_onceproperty 
protected var _once:Boolean = false

_paramsproperty 
protected var _params:Array

_priorityproperty 
protected var _priority:int = 0

_signalproperty 
protected var _signal:IOnceSignal

enabledproperty 
enabled:Boolean

Whether the listener is called on execution. Defaults to true.


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
listenerproperty 
listener:Function

The listener associated with this slot.


Implementation
    public function get listener():Function
    public function set listener(value:Function):void

Throws
ArgumentError ArgumentError: Given listener is null. Did you want to set enabled to false instead?
 
Error Error: Internal signal reference has not been set yet.
onceproperty 
once:Boolean  [read-only]

Whether this slot is automatically removed after it has been used once.


Implementation
    public function get once():Boolean
paramsproperty 
params:Array

Allows 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{}


Implementation
    public function get params():Array
    public function set params(value:Array):void
priorityproperty 
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.


Implementation
    public function get priority():int
Constructor Detail
Slot()Constructor
public function Slot(listener:Function, signal:IOnceSignal, once:Boolean = false, priority:int = 0)

Creates and returns a new Slot object.

Parameters
listener: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.

Throws
ArgumentError ArgumentError: Given listener is null.
 
Error Error: Internal signal reference has not been set yet.
Method Detail
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():void

Removes the slot from its signal.

toString()method 
public function toString():String

Creates and returns the string representation of the current object.

Returns
String — The string representation of the current object.
verifyListener()method 
protected function verifyListener(listener:Function):void

Parameters

listener:Function