HierarchicalCollection

public class
feathers.data.HierarchicalCollection

Description

Wraps a two-dimensional data source with a common API for use with UI controls that support this type of data.

API overview

Constructor

HierarchicalCollection ( data: Object = null )

Attributes

Public attributes

data: Object

The data source for this collection

dataDescriptor: IHierarchicalCollectionDataDescriptor

Describes the underlying data source by translating APIs

Functions

Public functions

addItemAt ( item: Object , index: Number , rest: Vector.<Object> ): Void

Adds an item to the collection, at the specified location

getItemAt ( index: Number , rest: Vector.<Object> ): Object

Returns the item at the specified location in the collection

getItemLocation ( item: Object , result: Vector.<Number> = null ): Vector.<Number>

Determines which location the item appears at within the collection

getLength ( rest: Vector.<Object> ): Number

The number of items at the specified location in the collection

isBranch ( node: Object ): Boolean

Determines if a node from the data source is a branch

removeItem ( item: Object ): Void

Removes a specific item from the collection

removeItemAt ( index: Number , rest: Vector.<Object> ): Object

Removes the item at the specified location from the collection and returns it

setItemAt ( item: Object , index: Number , rest: Vector.<Object> ): Void

Replaces the item at the specified location with a new item

updateItemAt ( index: Number , rest: Vector.<Object> ): Void

If an item doesn't dispatch an event or signal to indicate that it has changed, you can manually tell the collection about the change, and the collection will dispatch the CollectionEventType.UPDATE_ITEM event to manually notify the component that renders the data

Constructor

HierarchicalCollection ( data: Object = null )

Attributes

data: Object

The data source for this collection. May be any type of data, but a dataDescriptor needs to be provided to translate from the data source's APIs to something that can be understood by HierarchicalCollection.

dataDescriptor: IHierarchicalCollectionDataDescriptor

Describes the underlying data source by translating APIs.

Functions

addEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Registers an event listener at a certain object.

Parameters

type: String
listener: Function


addItemAt ( item: Object , index: Number , rest: Vector.<Object> ): Void

Adds an item to the collection, at the specified location.

Parameters

item: Object
index: Number
rest: Vector.<Object>


dispatchEvent ( event: Event ): Void
Inherited from EventDispatcher

Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.

Parameters

event: Event


dispatchEventWith ( type: String , bubbles: Boolean = false , data: Object = null ): Void
Inherited from EventDispatcher

Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.

Parameters

type: String
bubbles: Boolean = false
data: Object = null


getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getItemAt ( index: Number , rest: Vector.<Object> ): Object

Returns the item at the specified location in the collection.

Parameters

index: Number
rest: Vector.<Object>


getItemLocation ( item: Object , result: Vector.<Number> = null ): Vector.<Number>

Determines which location the item appears at within the collection. If the item isn't in the collection, returns null.

Parameters

item: Object
result: Vector.<Number> = null


getLength ( rest: Vector.<Object> ): Number

The number of items at the specified location in the collection.

Parameters

rest: Vector.<Object>


getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

hasEventListener ( type: String ): Boolean
Inherited from EventDispatcher

Returns if there are listeners registered for a certain event type.

Parameters

type: String


isBranch ( node: Object ): Boolean

Determines if a node from the data source is a branch.

Parameters

node: Object


removeEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Removes an event listener from the object.

Parameters

type: String
listener: Function


removeEventListeners ( type: String = null ): Void
Inherited from EventDispatcher

Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.

Parameters

type: String = null


removeItem ( item: Object ): Void

Removes a specific item from the collection.

Parameters

item: Object


removeItemAt ( index: Number , rest: Vector.<Object> ): Object

Removes the item at the specified location from the collection and returns it.

Parameters

index: Number
rest: Vector.<Object>


setItemAt ( item: Object , index: Number , rest: Vector.<Object> ): Void

Replaces the item at the specified location with a new item.

Parameters

item: Object
index: Number
rest: Vector.<Object>


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

updateItemAt ( index: Number , rest: Vector.<Object> ): Void

If an item doesn't dispatch an event or signal to indicate that it has changed, you can manually tell the collection about the change, and the collection will dispatch the CollectionEventType.UPDATE_ITEM event to manually notify the component that renders the data.

Parameters

index: Number
rest: Vector.<Object>