Packagetwaver
Classpublic class AlarmElementMapping
InheritanceAlarmElementMapping Inheritance Object
Implements IAlarmElementMapping

This class is used by AlarmBox. This class determine the corresponding relationship for alarms and elements managed by AlarmBox and ElementBox. Most of the time, the relationship of alarm and element is one-to-one determined by this AlarmElementMapping. However you may want change this to one-to-many relationship when an alarm occured it effect more than one element. In this case you can create or customize a new AlarmElementMapping class to implements this job. When alarm occured, AlarmBox will ask this class to know the elements this alarm affected. It also tell AlarmBox all alarms affecting a given element object.

To understand more about AlarmElementMapping, please check the demo with name "Alarm Mapping Demo" in TWaver Flex online demo and the source code.

AlarmElementMapping is the default implementation of interface IAlarmElementMapping. In this default implementation, TWaver will connect the alarm and element with alarm.elementID and element.id.

See also

twaver.Alarm
twaver.AlarmBox
twaver.ElementBox


Public Methods
 MethodDefined By
  
Constructor of this class.
AlarmElementMapping
  
dispose():void
Dispose the resources used in this class.
AlarmElementMapping
  
Get all corresponding alarms for the given element object.
AlarmElementMapping
  
Get all corresponding elements for the given alarm object.
AlarmElementMapping
Constructor Detail
AlarmElementMapping()Constructor
public function AlarmElementMapping(alarmBox:AlarmBox, elementBox:ElementBox)

Constructor of this class.

Parameters
alarmBox:AlarmBox — the AlarmBox this mapping class connected to.
 
elementBox:ElementBox — the ElementBox this mapping class connected to.
Method Detail
dispose()method
public function dispose():void

Dispose the resources used in this class.

getCorrespondingAlarms()method 
public function getCorrespondingAlarms(element:IElement):Array

Get all corresponding alarms for the given element object. In this default implementation, TWaver Flex will try to find all alarms which elementID is given element's ID.

Parameters

element:IElement — the element object need to find alarms on it.

Returns
Array — all corresponding alarms for this given element.
getCorrespondingElements()method 
public function getCorrespondingElements(alarm:IAlarm):Array

Get all corresponding elements for the given alarm object. In this default implementation, TWaver Flex will try to find the element which id is given alarm's elementID, return by an Array.

Parameters

alarm:IAlarm — the alarm object.

Returns
Array — all corresponding elements for this given alarm. In this defaul implementations class, TWaver will return the element which id equals to the given alarm's elementID.