Class fever.events.PriorityListenerArray

Description

Array structure used in PriorityEventBroadcaster class.
Manages listeners priority value.

See Also

Method Index

new PriorityListenerArray()
getIndex(), insert(), isEmpty(), listenerExists(), remove(), toString()

Constructor Detail

PriorityListenerArray

public function PriorityListenerArray()

Constructor

Can use Array instanciation way to build

   var a : new PriorityListenerArray( myListenerArray1, myListenerArray2, ...); 
 

Method Detail

getIndex

public function getIndex(listener):Number

Returns index Number of passed-in listener.

Parameters

listenerListener to check.

Return

Number index of listener or -1 if listener not exist.

listenerExists

public function listenerExists(listener):Boolean

Indicates if passed-in listener is referenced in structure.

Parameters

listenerListener to check.

Return

true is listener exist, either false

insert

public function insert(listener, priority:Number):Boolean

Adds passed-in listener into structure.

Example

   a.push( myListener, EventPriority.HIGHER );
 

Parameters

listenerListener to add.

Return

true if listener has been successfully added, either false (if already exist)

remove

public function remove(listener):Boolean

Removes passed-in listener from structure.

Parameters

listenerListener to remove.

Return

true if listener has been found and removed, either false

isEmpty

public function isEmpty():Boolean

Indicates if strucutre is empty.

Example var b : Boolean = a.isEmpty( myListener );

Return

true if structure contains no listeners, either false

toString

public function toString():String

Returns the string representation of this instance.

Overrides Array.toString method.

Return

String representation of this instance