| Package | com.sibirjak.angara.core |
| Class | public class Schedule |
| Inheritance | Schedule flash.events.EventDispatcher |
Holds internally a PriorityMap reference.
| Property | Defined by | ||
|---|---|---|---|
| numItemsLeft : uint [read-only]
Returns the number of resources left to load.
| Schedule | ||
| Method | Defined by | ||
|---|---|---|---|
|
Schedule()
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 | ||
| numItemsLeft | property |
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
| Schedule | () | constructor |
public function Schedule()Create a new Schedule instance.
| add | () | method |
public function add(loaderItem:ILoaderItem, priority:uint = 0):voidAdds a new loader item to the schedule.
The type can be either LoaderItemType.LOADER, LoaderItemType.SEQUENCE or LoaderItemType.SEQUENCE_MANAGER.
ParametersloaderItem:ILoaderItem — The item to add.
|
|
priority:uint (default = 0) — The priority to load the item.
|
| clear | () | method |
public function clear():voidRemoves all items from the queue.
| getNextItems | () | method |
public function getNextItems(numItems:uint):ArrayReturns 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.
ParametersnumItems:uint — The number of resource loaders to load at next.
|
Array |
| remove | () | method |
public function remove(loaderItem:ILoaderItem):voidRemoves a loader item from the queue.
ParametersloaderItem:ILoaderItem — The item to remove.
|
| toString | () | method |
public override function toString():StringInfo
ReturnsString |