Packageorg.apache.flex.collections
Classpublic class HierarchicalData
InheritanceHierarchicalData Inheritance EventDispatcher Inheritance flash.events.EventDispatcher
Implements IHierarchicalData

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Hierarchical data is data already in a structure of parent and child data items. The HierarchicalData class provides a default implementation for accessing and manipulating data.



Public Properties
 PropertyDefined By
  childrenField : String
Indicates the field name to be used to detect children objects in a data item.
HierarchicalData
  source : Object
The source collection.
HierarchicalData
Public Methods
 MethodDefined By
  
HierarchicalData(value:Object = null)
Constructor.
HierarchicalData
  
canHaveChildren(node:Object):Boolean
Returns true if the node can contain children.
HierarchicalData
  
getChildren(node:Object):Object
Returns an Object representing the node's children.
HierarchicalData
  
getData(node:Object):Object
Returns data from a node.
HierarchicalData
  
getRoot():Object
Returns the root data item.
HierarchicalData
  
hasChildren(node:Object):Boolean
Returns true if the node has children.
HierarchicalData
Property Detail
childrenFieldproperty
childrenField:String

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Indicates the field name to be used to detect children objects in a data item. By default, all subnodes are considered as children for XML data, and the children property is used for the Object data type. This is helpful in adapting to a data format that uses custom data fields to represent children.


Implementation
    public function get childrenField():String
    public function set childrenField(value:String):void
sourceproperty 
source:Object

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The source collection. The collection should implement the IList interface to facilitate operation like the addition and removal of items.


Implementation
    public function get source():Object
    public function set source(value:Object):void
Constructor Detail
HierarchicalData()Constructor
public function HierarchicalData(value:Object = null)

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Constructor.

Parameters
value:Object (default = null) — The data used to populate the HierarchicalData instance.
Method Detail
canHaveChildren()method
public function canHaveChildren(node:Object):Boolean

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Returns true if the node can contain children.

Nodes do not have to contain children for the method to return true. This method is useful in determining whether other nodes can be appended as children to the specified node.

Parameters

node:Object — The Object that defines the node.

Returns
Booleantrue if the node can contain children.
getChildren()method 
public function getChildren(node:Object):Object

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Returns an Object representing the node's children.

Parameters

node:Object — The Object that defines the node. If null, return a collection of top-level nodes.

Returns
Object — An Object containing the children nodes.
getData()method 
public function getData(node:Object):Object

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Returns data from a node.

Parameters

node:Object — The node Object from which to get the data.

Returns
Object — The requested data.
getRoot()method 
public function getRoot():Object

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Returns the root data item.

Returns
Object — The Object containing the root data item.
hasChildren()method 
public function hasChildren(node:Object):Boolean

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Returns true if the node has children.

Parameters

node:Object — The Object that defines the node.

Returns
Booleantrue if the node has children.