Packagespark.collections
Classpublic class NumericDataProvider
InheritanceNumericDataProvider Inheritance OnDemandEventDispatcher Inheritance Object
Implements IList

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

This IList class generates items that are a sequential series of numbers. The numbers range between the minimum and maximum properties. The stepSize property defines the difference between an item and the next item.

This class is used primarily as a data provider for the SpinnerList control; for example:

 <s:SpinnerList>
   <s:dataProvider>
     <s:NumericDataProvider minimum="0" maximum="23" stepSize="1"/>
   </s:dataProvider>
 </s:SpinnerList> 
 

The advantage of this class is that the item values are calculated on demand, instead of stored.

Because the values are calculated instead of stored, the addItem(), addItemAt(), removeAll(), removeItemAt(), itemUpdated() and setItemAt() IList methods are not supported.

See also

spark.components.SpinnerList
mx.collections.IList


Public Properties
 PropertyDefined By
  length : int
[read-only] The number of items in this collection.
NumericDataProvider
  maximum : Number
The value of the last item.
NumericDataProvider
  minimum : Number
The value of the first item.
NumericDataProvider
  stepSize : Number
The stepSize property controls the values of items between the first and last items.
NumericDataProvider
Public Methods
 MethodDefined By
  
Constructor.
NumericDataProvider
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
OnDemandEventDispatcher
  
addItem(item:Object):void
This function is not supported.
NumericDataProvider
  
addItemAt(item:Object, index:int):void
This function is not supported.
NumericDataProvider
 Inherited
dispatchEvent(event:Event):Boolean
OnDemandEventDispatcher
  
getItemAt(index:int, prefetch:int = 0):Object
Gets the item at the specified index.
NumericDataProvider
  
getItemIndex(item:Object):int
Returns the index of the item if it is in the list such that getItemAt(index) == item.
NumericDataProvider
 Inherited
hasEventListener(type:String):Boolean
OnDemandEventDispatcher
  
itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void
This function is not supported.
NumericDataProvider
  
removeAll():void
This function is not supported.
NumericDataProvider
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
OnDemandEventDispatcher
  
removeItem(item:Object):Boolean
This function is not supported.
NumericDataProvider
  
removeItemAt(index:int):Object
This function is not supported.
NumericDataProvider
  
setItemAt(item:Object, index:int):Object
This function is not supported.
NumericDataProvider
  
toArray():Array
Returns an Array that is populated in the same order as the IList implementation.
NumericDataProvider
 Inherited
willTrigger(type:String):Boolean
OnDemandEventDispatcher
Property Detail
lengthproperty
length:int  [read-only]

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

The number of items in this collection. 0 means no items while -1 means the length is unknown.


Implementation
    public function get length():int
maximumproperty 
maximum:Number

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

The value of the last item. This value must be larger than the minimum value.

The default value is 100.


Implementation
    public function get maximum():Number
    public function set maximum(value:Number):void
minimumproperty 
minimum:Number

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

The value of the first item. This value must be smaller than the minimum value.

The default value is 0.


Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
stepSizeproperty 
stepSize:Number

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

The stepSize property controls the values of items between the first and last items. For each item, the value is calculated as the sum of the minimum and the item's index multiplied by this property.

For example, if minimum is 10, maximum is 20, and this property is 3, then the item values of this data provider are 10, 13, 16, 19, and 20.

The default value is 1.


Implementation
    public function get stepSize():Number
    public function set stepSize(value:Number):void
Constructor Detail
NumericDataProvider()Constructor
public function NumericDataProvider()

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

Constructor.

Method Detail
addItem()method
public function addItem(item:Object):void

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

This function is not supported.

Parameters

item:Object

addItemAt()method 
public function addItemAt(item:Object, index:int):void

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

This function is not supported.

Parameters

item:Object
 
index:int

getItemAt()method 
public function getItemAt(index:int, prefetch:int = 0):Object

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

Gets the item at the specified index.

Parameters

index:int — The index in the list from which to retrieve the item.
 
prefetch:int (default = 0) — An int indicating both the direction and number of items to fetch during the request if the item is not local.

Returns
Object — The item at that index, or null if there is none.
getItemIndex()method 
public function getItemIndex(item:Object):int

Returns the index of the item if it is in the list such that getItemAt(index) == item.

Note: unlike IViewCursor.findxxx() methods, The getItemIndex() method cannot take a parameter with only a subset of the fields in the item being serched for; this method always searches for an item that exactly matches the input parameter.

Parameters

item:Object — The item to find.

Returns
int — The index of the item, or -1 if the item is not in the list.
itemUpdated()method 
public function itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

This function is not supported.

Parameters

item:Object
 
property:Object (default = null)
 
oldValue:Object (default = null)
 
newValue:Object (default = null)

removeAll()method 
public function removeAll():void

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

This function is not supported.

removeItem()method 
public function removeItem(item:Object):Boolean

Language Version : ActionScript 3.0
Product Version : Flex 4.10
Runtime Versions : Flash Player 11, AIR 3

This function is not supported.

Parameters

item:Object

Returns
Boolean
removeItemAt()method 
public function removeItemAt(index:int):Object

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

This function is not supported.

Parameters

index:int

Returns
Object
setItemAt()method 
public function setItemAt(item:Object, index:int):Object

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

This function is not supported.

Parameters

item:Object
 
index:int

Returns
Object
toArray()method 
public function toArray():Array

Language Version : ActionScript 3.0
Product Version : Flex 4.6
Runtime Versions : Flash Player 11, AIR 3

Returns an Array that is populated in the same order as the IList implementation. This method can throw an ItemPendingError.

Returns
Array — The array.