Packagecom.sibirjak.angara.core
Classpublic class Schedule
InheritanceSchedule Inheritance flash.events.EventDispatcher

The LoaderManager queue.

Holds internally a PriorityMap reference.



Public Properties
 PropertyDefined by
  numItemsLeft : uint
[read-only] Returns the number of resources left to load.
Schedule
Public Methods
 MethodDefined by
  
Create a new Schedule instance.
Schedule
  
add(loaderItem:ILoaderItem, priority:uint = 0):void
Adds a new loader item to the schedule.
Schedule
  
clear():void
Removes all items from the queue.
Schedule
  
getNextItems(numItems:uint):Array
Returns a list of resource loaders to be loaded at next.
Schedule
  
remove(loaderItem:ILoaderItem):void
Removes a loader item from the queue.
Schedule
  
toString():String
Info
Schedule
Property detail
numItemsLeftproperty
numItemsLeft:uint  [read-only]

Returns the number of resources left to load.

Adding 2 loader, finishing 1 loader will then return 1.

The value will be calculated at runtime with a worst complexity O(n) where n is the number of resource loaders added directly or to a container.

Implementation
    public function get numItemsLeft():uint
Constructor detail
Schedule()constructor
public function Schedule()

Create a new Schedule instance.

Method detail
add()method
public function add(loaderItem:ILoaderItem, priority:uint = 0):void

Adds a new loader item to the schedule.

The type can be either LoaderItemType.LOADER, LoaderItemType.SEQUENCE or LoaderItemType.SEQUENCE_MANAGER.

Parameters
loaderItem:ILoaderItem — The item to add.
 
priority:uint (default = 0) — The priority to load the item.
clear()method 
public function clear():void

Removes all items from the queue.

getNextItems()method 
public function getNextItems(numItems:uint):Array

Returns a list of resource loaders to be loaded at next.

This method uses a recursive iterator to find all containers (sequence, sequence manager) and resource loaders of status LoaderItemStatus.WAITING. Each possible item will be filtered with an ItemTypeFilterIterator to finally get only resource loaders.

The length of the list may be lesser than the specified numItems value in 2 cases: When no more waiting resource loaders are scheduled and secondly if an item defines a callback. Then we have to wait for the callbacks finish to continue loading resources.

For a high performance all containers are supposed to remove their finished items (LoaderItemStatus.COMPLETE, LoaderItemStatus.FAILURE) immediately.

Parameters
numItems:uint — The number of resource loaders to load at next.

Returns
Array
remove()method 
public function remove(loaderItem:ILoaderItem):void

Removes a loader item from the queue.

Parameters
loaderItem:ILoaderItem — The item to remove.
toString()method 
public override function toString():String

Info

Returns
String