Packagecom.sibirjak.angara.sequence
Classpublic class SequenceManager
InheritanceSequenceManager Inheritance AbstractLoaderItem Inheritance AbstractProgressInfo Inheritance flash.events.EventDispatcher
ImplementsISequenceManager

The Sequence manager controls the behaviour of a set of sequences.

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.



Public Properties
 PropertyDefined by
 InheriteditemType : String
The type of the loader item.
AbstractLoaderItem
 Inheritedkey : 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
 Inheritedscheduled : Boolean
Returns true, if the item already has been added to the loader manager directly or to a sequence or a sequence manager.
AbstractLoaderItem
 Inheritedstatus : String
The current loading status.
AbstractLoaderItem
Protected Properties
 PropertyDefined by
 Inherited_isScheduled : Boolean = false
The schedule marker.
AbstractLoaderItem
 Inherited_key : String
The key used for debugging purposes.
AbstractLoaderItem
 Inherited_numItems : uint = 0
The number of items added.
AbstractProgressInfo
 Inherited_numItemsFailed : uint = 0
The number of items failed loading.
AbstractProgressInfo
 Inherited_numItemsLoaded : uint = 0
The number of items alredy loaded.
AbstractProgressInfo
 Inherited_progress : Number = 0
The overall progress of the item.
AbstractProgressInfo
 Inherited_status : String
The loader item status.
AbstractLoaderItem
 Inherited_type : String
The loader item type.
AbstractLoaderItem
Public Methods
 MethodDefined by
  
Creates a new SequenceManager instance.
SequenceManager
  
add(sequence:ISequence):void
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
  
remove(sequence:ISequence):void
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
Protected Methods
 MethodDefined by
  
dispatchAdd(sequence:ISequence):void
Dispatches the LoaderItemEvent.ADD event.
SequenceManager
  
Dispatches the LoaderItemEvent.COMPLETE event.
SequenceManager
  
Dispatches the LoaderItemEvent.PAUSE event.
SequenceManager
  
Dispatches the LoaderItemEvent.PROGRESS event.
SequenceManager
  
dispatchRemove(sequence:ISequence):void
Dispatches the LoaderItemEvent.REMOVE event.
SequenceManager
  
Dispatches the LoaderItemEvent.RESUME event.
SequenceManager
  
dispatchStop():void
Dispatches the LoaderItemEvent.STOP event.
SequenceManager
Property detail
numItemsproperty
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
numItemsFailedproperty 
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
numItemsLoadedproperty 
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
progressproperty 
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
Constructor detail
SequenceManager()constructor
public function SequenceManager()

Creates a new SequenceManager instance.

Method detail
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.

Parameters
sequence: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.

Parameters
sequence: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.

Parameters
sequence: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.

Parameters
cursor:*

Returns
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.

Parameters
sequence: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.

Parameters
sequence: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

Returns
String