Packagesystem.signals
Classpublic class InternalSignal
InheritanceInternalSignal Inheritance Object
Implements Signaler
Subclasses Signal

This core basic class provides all basic methods of the system.events.Signal interface. You must overrides this class and defines the content emit() method.



Public Properties
 PropertyDefined By
  length : uint
[read-only] Indicates the number of receivers connected.
InternalSignal
  types : *
Determinates the optional Array representation of all valid types of this signal.
InternalSignal
Protected Properties
 PropertyDefined By
  receivers : Vector.<SignalEntry>
The Array representation of all receivers.
InternalSignal
Public Methods
 MethodDefined By
  
InternalSignal(types:Array = null, receivers:Array = null)
Creates a new InternalSignal instance.
InternalSignal
  
checkValues(values:Array):void
Checks all values passed-in the emit method.
InternalSignal
  
connect(receiver:*, priority:uint = 0, autoDisconnect:Boolean = false):Boolean
Connects a Function or a Receiver object.
InternalSignal
  
connected():Boolean
Returns true if one or more receivers are connected.
InternalSignal
  
disconnect(receiver:* = null):Boolean
Disconnect the specified object or all objects if the parameter is null.
InternalSignal
  
emit(... values):void
Emit the specified values to the receivers.
InternalSignal
  
hasReceiver(receiver:*):Boolean
Returns true if the specified receiver is connected.
InternalSignal
  
toArray():Array
Returns the Array representation of all receivers connected with the signal.
InternalSignal
  
toVector():Vector.<Function>
Returns the Vector representation of all receivers connected with the signal.
InternalSignal
Property Detail
lengthproperty
length:uint  [read-only]

Indicates the number of receivers connected.


Implementation
    public function get length():uint
receiversproperty 
protected var receivers:Vector.<SignalEntry>

The Array representation of all receivers.

typesproperty 
types:*

Determinates the optional Array representation of all valid types of this signal. If this property is null the signal don't use type validation.


Implementation
    public function get types():*
    public function set types(value:any):void
Constructor Detail
InternalSignal()Constructor
public function InternalSignal(types:Array = null, receivers:Array = null)

Creates a new InternalSignal instance.

Parameters
types:Array (default = null) — An optional Array who contains any number of class references that enable type checks in the "emit" method. If this argument is null the "emit" method not check the types of the parameters in the method.
 
receivers:Array (default = null) — The Array collection of receiver objects to connect with this signal.
Method Detail
checkValues()method
public function checkValues(values:Array):void

Checks all values passed-in the emit method.

Parameters

values:Array

connect()method 
public function connect(receiver:*, priority:uint = 0, autoDisconnect:Boolean = false):Boolean

Connects a Function or a Receiver object.

Parameters

receiver:* — The receiver to connect : a Function reference or a Receiver object.
 
priority:uint (default = 0) — Determinates the priority level of the receiver.
 
autoDisconnect:Boolean (default = false) — Apply a disconnect after the first trigger

Returns
Booleantrue If the receiver is connected with the signal emitter.
connected()method 
public function connected():Boolean

Returns true if one or more receivers are connected.

Returns
Booleantrue if one or more receivers are connected.
disconnect()method 
public function disconnect(receiver:* = null):Boolean

Disconnect the specified object or all objects if the parameter is null.

Parameters

receiver:* (default = null)

Returns
Booleantrue if the specified receiver exist and can be unregister.
emit()method 
public function emit(... values):void

Emit the specified values to the receivers.

Parameters

... values — All values to emit to the receivers.

hasReceiver()method 
public function hasReceiver(receiver:*):Boolean

Returns true if the specified receiver is connected.

Parameters

receiver:*

Returns
Booleantrue if the specified receiver is connected.
toArray()method 
public function toArray():Array

Returns the Array representation of all receivers connected with the signal.

Returns
Array — the Array representation of all receivers connected with the signal.
toVector()method 
public function toVector():Vector.<Function>

Returns the Vector representation of all receivers connected with the signal.

Returns
Vector.<Function> — the Vector representation of all receivers connected with the signal.