ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
org.osmf.net.metrics 

MetricFactory  - AS3 OSMF

Packageorg.osmf.net.metrics
Classpublic class MetricFactory
InheritanceMetricFactory Inheritance Object
Subclasses DefaultMetricFactory

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

MetricFactory represents a factory class for metrics.

The factory operation produces a MetricBase as output.

The MetricFactory maintains a list of MetricFactoryItem objects, each of which encapsulates all the information necessary to create a specific metric.

Related API Elements

org.osmf.net.abr.MetricBase
org.osmf.net.abr.DefaultMetricFactory


Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  numItems : Number
[read-only] The number of items
MetricFactory
Public Methods
 MethodDefined By
  
Constructor.
MetricFactory
  
Adds the specified MetricFactoryItem to the factory.
MetricFactory
  
Produces a MetricBase.
MetricFactory
  
The item corresponding to the specified metric type
MetricFactory
  
The registered items
MetricFactory
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Removes the specified MetricFactoryItem from the factory.
MetricFactory
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail

numItems

property
numItems:Number  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

The number of items



Implementation
    public function get numItems():Number
Constructor Detail

MetricFactory

()Constructor
public function MetricFactory(qosInfoHistory:QoSInfoHistory)

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

Constructor.

Parameters
qosInfoHistory:QoSInfoHistory
Method Detail

addItem

()method
public function addItem(item:MetricFactoryItem):void

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

Adds the specified MetricFactoryItem to the factory. If a MetricFactoryItem with the same ID already exists in this factory, the new MetricFactoryItem object replaces it.

Parameters

item:MetricFactoryItem — The MetricFactoryItem to add.

Throws
ArgumentError — If the argument is null or if the argument has a null type field.

buildMetric

()method 
public function buildMetric(type:String, ... args):MetricBase

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

Produces a MetricBase.

Parameters

type:String — The type of the metric to create.
 
... args — The arguments to be passed to the metric's constructor (except the qosInfoHistory)

Returns
MetricBase — A new MetricBase of the desired type with the specified parameters

Throws
Error — If the type is not registered with any MetricFactoryItem.

getItem

()method 
public function getItem(type:String):MetricFactoryItem

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

The item corresponding to the specified metric type

Parameters

type:String

Returns
MetricFactoryItem — The item corresponding to the specified type or null if no such item exists

getItems

()method 
public function getItems():Vector.<MetricFactoryItem>

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

The registered items

Returns
Vector.<MetricFactoryItem> — A new Vector.<MetricFactoryItem> containing the registered items

removeItem

()method 
public function removeItem(item:MetricFactoryItem):void

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

Removes the specified MetricFactoryItem from the factory. If no such MetricFactoryItem exists in this factory, does nothing.

Parameters

item:MetricFactoryItem — The MetricFactoryItem to remove.

Throws
ArgumentError — If the argument is null or if the argument has a null type field.