Packagetwaver
Interfacepublic interface IData extends flash.events.IEventDispatcher, IClient
Implementors Data

This class defines a very high level managed object data model for TWaver Flex. TWaver defines many data for telecom network and equipment, such as node, link, group, subnetwork, elements used on equipment chassis, and alarm, layer. All these data are subclasses or implementations of this high-level abstract data.

This data class defines simple properties for all data used int TWaver Flex. Data ID, name, icon, tooltip, parent/children, and more. Data can be XML serialized or unserialized. Data extends from IEventDispatcher so it able to dispatch events when property changed.



Public Properties
 PropertyDefined By
  children : ICollection
[read-only] Get all children data as a collection.
IData
  childrenCount : int
[read-only] Get total children count.
IData
 InheritedclientProperties : ICollection
[read-only] Get a ICollection that contians all client proerty name.
IClient
  hasChildren : Boolean
[read-only] Check whether this data has children data.
IData
  icon : String
The small icon of this data.
IData
  id : Object
[read-only] The ID of this data.
IData
  name : String
Get the name of this data.
IData
  parent : IData
Get parent data.
IData
  toolTip : String
Get tooltip of this data.
IData
Public Methods
 MethodDefined By
  
addChild(child:IData, index:int = 0):Boolean
Add the specified data as a child of current data at the specified children index location.
IData
  
addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void
Add a property change listener on this data so it can be notified on any property changed.
IData
  
clearChildren():Boolean
Clear all children objects from this data.
IData
  
deserializeXML(serializer:XMLSerializer, dataXML:XML):void
Deserialize data from specified XML data.
IData
  
dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean
Dispatch property change event.
IData
  
getChildAt(index:int):IData
Get child data from specified children location.
IData
 Inherited
getClient(clientProp:String):*
Get the specified client property.
IClient
  
getPropertyValue(property:String):Object
Get an user defined property on this data.
IData
  
hasOwnProperty(name:String):Boolean
Whether current data has created specified property.
IData
  
isDescendantOf(data:IData):Boolean
Check whether this data is a descendant of the specified data.
IData
  
isParentOf(data:IData):Boolean
Check whether this data is the parent of specified data.
IData
  
isRelatedTo(data:IData):Boolean
Check whether this data and the specified data has any relationship of descendant.
IData
  
removeChild(child:IData):Boolean
Remove the specified child data from children of current data.
IData
  
removePropertyChangeListener(listener:Function):void
Remove the specified property change listener from this data.
IData
  
serializeXML(serializer:XMLSerializer, newInstance:IData):void
Serialize this data into XML.
IData
 Inherited
setClient(clientProp:String, newValue:*):IClient
Set a client property by specified property name and property value.
IClient
  
setPropertyValue(property:String, value:Object):void
Set an user defined property on this data.
IData
  
toChildren(matchFunction:Function = null):ICollection
Return all children as a collection filtered by the specified function.
IData
  
toString():String
IData
Property Detail
childrenproperty
children:ICollection  [read-only]

Get all children data as a collection.


Implementation
    public function get children():ICollection
childrenCountproperty 
childrenCount:int  [read-only]

Get total children count.


Implementation
    public function get childrenCount():int
hasChildrenproperty 
hasChildren:Boolean  [read-only]

Check whether this data has children data.


Implementation
    public function get hasChildren():Boolean
iconproperty 
icon:String

The small icon of this data. It will be displayed on tree, table or other views. Data like node, group, subnetwork will displays image on network view, not icon.


Implementation
    public function get icon():String
    public function set icon(value:String):void
idproperty 
id:Object  [read-only]

The ID of this data. This is an unique ID value can not duplicatable for one data box.


Implementation
    public function get id():Object
nameproperty 
name:String

Get the name of this data. Name is just a simple string value represents the name of this data. It can by any value, can be duplicatable, can be changed anytime. Name will be displayed on network by a label.


Implementation
    public function get name():String
    public function set name(value:String):void
parentproperty 
parent:IData

Get parent data.


Implementation
    public function get parent():IData
    public function set parent(value:IData):void
toolTipproperty 
toolTip:String

Get tooltip of this data. Tooltip text is the text message displayed on all views when mouse cursor move over the data and stop for a short time.


Implementation
    public function get toolTip():String
    public function set toolTip(value:String):void
Method Detail
addChild()method
public function addChild(child:IData, index:int = 0):Boolean

Add the specified data as a child of current data at the specified children index location.

Parameters

child:IData — the child data to be added.
 
index:int (default = 0) — the children index location of this new child data to be added.

Returns
Boolean — true if added successfully, false otherwise.
addPropertyChangeListener()method 
public function addPropertyChangeListener(listener:Function, priority:int = 0, useWeakReference:Boolean = false):void

Add a property change listener on this data so it can be notified on any property changed.

Parameters

listener:Function — the property change listener to be added
 
priority:int (default = 0) — listening priority
 
useWeakReference:Boolean (default = false) — whether use weak reference

clearChildren()method 
public function clearChildren():Boolean

Clear all children objects from this data. All children data will be removed from current data children collection, but will not removed from the data box/element box.

Returns
Boolean — true if cleared successfully, false otherwise.
deserializeXML()method 
public function deserializeXML(serializer:XMLSerializer, dataXML:XML):void

Deserialize data from specified XML data.

Parameters

serializer:XMLSerializer — the XML serializer
 
dataXML:XML — the XML data contains TWaver data.

dispatchPropertyChangeEvent()method 
public function dispatchPropertyChangeEvent(property:String, oldValue:Object, newValue:Object):Boolean

Dispatch property change event.

Parameters

property:String — property name has changed.
 
oldValue:Object — old value before the change.
 
newValue:Object — new value after the change.

Returns
Boolean — true if dispatch successfully, false otherwise.
getChildAt()method 
public function getChildAt(index:int):IData

Get child data from specified children location.

Parameters

index:int — the location that child located.

Returns
IData — the child data at the specified location.
getPropertyValue()method 
public function getPropertyValue(property:String):Object

Get an user defined property on this data.

Parameters

property:String — the property name need to get.

Returns
Object — property value of specified property.
hasOwnProperty()method 
public function hasOwnProperty(name:String):Boolean

Whether current data has created specified property.

Parameters

name:String — the property name to be checked.

Returns
Boolean — true if this property has been created on this data, false otherwise.
isDescendantOf()method 
public function isDescendantOf(data:IData):Boolean

Check whether this data is a descendant of the specified data.

Parameters

data:IData — the data to be checked.

Returns
Boolean — true if this data is a descendant of the specified data, false otherwise.
isParentOf()method 
public function isParentOf(data:IData):Boolean

Check whether this data is the parent of specified data.

Parameters

data:IData — the data to be checked.

Returns
Boolean — true if this data is parent of the specified data, false otherwise.
isRelatedTo()method 
public function isRelatedTo(data:IData):Boolean

Check whether this data and the specified data has any relationship of descendant.

Parameters

data:IData — the data to be checked.

Returns
Boolean — true if has relationship of descendant, false otherwise.
removeChild()method 
public function removeChild(child:IData):Boolean

Remove the specified child data from children of current data.

Parameters

child:IData — the child data to be removed.

Returns
Boolean — true if removed successfully, false otherwise.
removePropertyChangeListener()method 
public function removePropertyChangeListener(listener:Function):void

Remove the specified property change listener from this data.

Parameters

listener:Function — the listener to be removed.

serializeXML()method 
public function serializeXML(serializer:XMLSerializer, newInstance:IData):void

Serialize this data into XML.

Parameters

serializer:XMLSerializer — the XML serializer.
 
newInstance:IData — a new instance that will be used for property value comparision during the XML serialization.

setPropertyValue()method 
public function setPropertyValue(property:String, value:Object):void

Set an user defined property on this data. If property not exist, then create; otherwise, replace it.

Parameters

property:String — the property name to be set.
 
value:Object — the value of this property.

toChildren()method 
public function toChildren(matchFunction:Function = null):ICollection

Return all children as a collection filtered by the specified function.

Parameters

matchFunction:Function (default = null) — the filter function decides which child should be in the returned collection.

Returns
ICollection — the collection contains all children data that matchs the filter.
toString()method 
public function toString():String

Returns
String