Package | com.sibirjak.angara.sequence |
Class | public class SequenceManager |
Inheritance | SequenceManager ![]() ![]() ![]() |
Implements | ISequenceManager |
Completed sequences will be removed from the internal sequence list and therefore won't be considered in enumeration using the manager's iterator. They won't be considered any more in calculating the progress values.
Property | Defined by | ||
---|---|---|---|
![]() | itemType : String
The type of the loader item.
| AbstractLoaderItem | |
![]() | key : String
Returns the identifying key of the loader item.
| AbstractLoaderItem | |
numItems : uint [read-only]
Returns the number of items to be loaded within the loader item.
| SequenceManager | ||
numItemsFailed : uint [read-only]
Returns the number of items failed within the loader item.
| SequenceManager | ||
numItemsLoaded : uint [read-only]
Returns the number of items loaded within the loader item.
| SequenceManager | ||
progress : Number [read-only]
Returns the progress of the loader item as a decimal value between zero and 1.
| SequenceManager | ||
![]() | scheduled : Boolean
Returns true, if the item already has been added to the loader manager
directly or to a sequence or a sequence manager.
| AbstractLoaderItem | |
![]() | status : String
The current loading status.
| AbstractLoaderItem |
Method | Defined by | ||
---|---|---|---|
Creates a new SequenceManager instance.
| SequenceManager | ||
Adds a sequence to a sequence manager.
| SequenceManager | ||
clear():void
Stops all loaders and removes all sequence references from the manager.
| SequenceManager | ||
iterator(cursor:*):IIterator
Returns an iterator over all sequences left.
| SequenceManager | ||
loadBeforeOthers(sequence:ISequence):void
Reprioritised a sequence to be loaded before all other sequences
in a sequence manager.
| SequenceManager | ||
pause():void
Marks the item to be ignored by subsequent loader manager queue pulling operations.
| SequenceManager | ||
pauseAllExcept(sequence:ISequence):void
Pauses all other sequences and resumes the specified sequence.
| SequenceManager | ||
Removes a sequence from a sequence manager.
| SequenceManager | ||
resume():void
Marks a prior paused item to be eligible for loader manager queue polling
operations.
| SequenceManager | ||
stop():void
Immediately stops loading of the item or its containing items.
| SequenceManager | ||
toString():String
Info
| SequenceManager |
Method | Defined by | ||
---|---|---|---|
dispatchAdd(sequence:ISequence):void
Dispatches the LoaderItemEvent.ADD event.
| SequenceManager | ||
dispatchComplete():void
Dispatches the LoaderItemEvent.COMPLETE event.
| SequenceManager | ||
dispatchPause():void
Dispatches the LoaderItemEvent.PAUSE event.
| SequenceManager | ||
dispatchProgress():void
Dispatches the LoaderItemEvent.PROGRESS event.
| SequenceManager | ||
dispatchRemove(sequence:ISequence):void
Dispatches the LoaderItemEvent.REMOVE event.
| SequenceManager | ||
dispatchResume():void
Dispatches the LoaderItemEvent.RESUME event.
| SequenceManager | ||
dispatchStop():void
Dispatches the LoaderItemEvent.STOP event.
| SequenceManager |
numItems | property |
numItems:uint
[read-only]Returns the number of items to be loaded within the loader item.
If the item is of type LoaderItemType.LOADER the number will be always 1.
If the item is of type LoaderItemType.SEQUENCE, the method returns the number of all loaders added to the sequence. Removing a loader from the sequence will decrease this value by 1.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, the method returns the cumulative number of items of all assigned sequences. The value will be calculated at runtime.
Implementation public function get numItems():uint
numItemsFailed | property |
numItemsFailed:uint
[read-only]Returns the number of items failed within the loader item.
If the item is of type LoaderItemType.LOADER the number will be zero initally and 1, if the loader could not successfully finish loading. In this case numItemsLoaded() will return zero.
If the item is of type LoaderItemType.SEQUENCE, the method returns the number of all failed loaders added to the sequence.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, the method returns the cumulative number of failed items of all assigned sequences. The value will be calculated at runtime.
Implementation public function get numItemsFailed():uint
numItemsLoaded | property |
numItemsLoaded:uint
[read-only]Returns the number of items loaded within the loader item.
If the item is of type LoaderItemType.LOADER the number will be zero initally and 1, after the loader has been completed successfully.
If the item is of type LoaderItemType.SEQUENCE, the method returns the number of all completed loaders added to the sequence.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, the method returns the cumulative number of loaded items of all assigned sequences. The value will be calculated at runtime.
Implementation public function get numItemsLoaded():uint
progress | property |
progress:Number
[read-only]Returns the progress of the loader item as a decimal value between zero and 1.
If the item is of type LoaderItemType.LOADER the number will be zero initally and 1, after the loader has been completed successfully. The progress will not be reset if the loader fails e.g. after a progress of 0.5. It is guaranteed, that the progress value is set to 1 at the time the COMPLETE event is dispatched.
If the item is of type LoaderItemType.SEQUENCE, the method returns the overall progress of that sequence. It is possible specify a weight to each added loader to achieve a unbalanced distibution of loader progress values.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, the method returns the arithmetic average of the progress of all assigned sequences. The value will be calculated at runtime.
Implementation public function get progress():Number
SequenceManager | () | constructor |
public function SequenceManager()
Creates a new SequenceManager instance.
add | () | method |
public function add(sequence:ISequence):void
Adds a sequence to a sequence manager.
Its possible to add sequence at any time of loading to a sequence manager but not after the sequence manager has been marked as complete.
Parameterssequence:ISequence — The sequence to manage within this manager.
|
clear | () | method |
public function clear():void
Stops all loaders and removes all sequence references from the manager.
dispatchAdd | () | method |
protected function dispatchAdd(sequence:ISequence):void
Dispatches the LoaderItemEvent.ADD event.
Parameterssequence:ISequence |
dispatchComplete | () | method |
protected function dispatchComplete():void
Dispatches the LoaderItemEvent.COMPLETE event.
dispatchPause | () | method |
protected function dispatchPause():void
Dispatches the LoaderItemEvent.PAUSE event.
dispatchProgress | () | method |
protected function dispatchProgress():void
Dispatches the LoaderItemEvent.PROGRESS event.
dispatchRemove | () | method |
protected function dispatchRemove(sequence:ISequence):void
Dispatches the LoaderItemEvent.REMOVE event.
Parameterssequence:ISequence |
dispatchResume | () | method |
protected function dispatchResume():void
Dispatches the LoaderItemEvent.RESUME event.
dispatchStop | () | method |
protected function dispatchStop():void
Dispatches the LoaderItemEvent.STOP event.
iterator | () | method |
public function iterator(cursor:*):IIterator
Returns an iterator over all sequences left.
Parameterscursor:* |
IIterator — Iterator over all left sequences.
|
loadBeforeOthers | () | method |
public function loadBeforeOthers(sequence:ISequence):void
Reprioritised a sequence to be loaded before all other sequences in a sequence manager.
Parameterssequence:ISequence — The sequence to load before other sequences.
|
pause | () | method |
public override function pause():void
Marks the item to be ignored by subsequent loader manager queue pulling operations.
Sets the items status to LoaderItemStatus.PAUSED. Does only have effect to items which status is LoaderItemStatus.WAITING. You cannot pause a loading or finished item. To interrupt loading you need to call stop() for the particular item.
If the item is of type LoaderItemType.SEQUENCE, only the sequence will be marked as paused.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, only the sequence manager will be marked as paused.
pauseAllExcept | () | method |
public function pauseAllExcept(sequence:ISequence):void
Pauses all other sequences and resumes the specified sequence.
Does not stop resource loaders of other sequences. Sequence will therefore resume loading not before all loaders of other sequences are finished (complete or failure). Parameters
sequence:ISequence — The sequence to resume while all others gets paused.
|
remove | () | method |
public function remove(sequence:ISequence):void
Removes a sequence from a sequence manager.
Parameterssequence:ISequence — The sequence to remove from the manager.
|
resume | () | method |
public override function resume():void
Marks a prior paused item to be eligible for loader manager queue polling operations.
Sets the items status to LoaderItemStatus.WAITING. Does only have effect to items which status is LoaderItemStatus.PAUSED.
If the item is of type LoaderItemType.SEQUENCE, only the sequence's status will be affected.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, only the sequence manager's status will be affected.
stop | () | method |
public override function stop():void
Immediately stops loading of the item or its containing items.
If the item is of type LoaderItemType.LOADER and is currently being loading, the associated net connection will be closed. Does only have effect to resource loaders, which status is LoaderItemStatus.LOADING. Sets the loader status back to LoaderItemStatus.WAITING. You cannot stop finished loaders (LoaderItemStatus.COMPLETE, LoaderItemStatus.FAILURE) any more.
If the item is of type LoaderItemType.SEQUENCE, all open loaders assigned to the seqeunce will be stopped.
If the item is of type LoaderItemType.SEQUENCE_MANAGER, the stop method of all assigned sequences will be called.
toString | () | method |
public override function toString():String
Info
ReturnsString |