//////////////////////////////////////////////////////////////////////////////// // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// package mx.collections { import flash.events.IEventDispatcher; import mx.events.CollectionEvent; /** * Dispatched when the IList has been updated in some way. * * @eventType mx.events.CollectionEvent.COLLECTION_CHANGE * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ [Event(name="collectionChange", type="mx.events.CollectionEvent")] /** * A collection of items organized in an ordinal fashion. * Provides access and manipulation methods based on index. * *
An IList
may be a view onto data
* that has been retrieved from a remote location.
* When writing for a collection that may be remote,
* it is important to handle the case where data
* may not yet be available, which is indicated
* by the ItemPendingError
.
The ICollectionView
is an alternative
* to the IList
.
addItemAt(item, length)
.
*
* @param item The item to add.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function addItem(item:Object):void;
/**
* Adds the item at the specified index.
* The index of any item greater than the index of the added item is increased by one.
* If the the specified index is less than zero or greater than the length
* of the list, a RangeError is thrown.
*
* @param item The item to place at the index.
*
* @param index The index at which to place the item.
*
* @throws RangeError if index is less than 0 or greater than the length of the list.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function addItemAt(item:Object, index:int):void;
/**
* Gets the item at the specified index.
*
* @param index The index in the list from which to retrieve the item.
*
* @param prefetch An int
indicating both the direction
* and number of items to fetch during the request if the item is
* not local.
*
* @return The item at that index, or null
if there is none.
*
* @throws mx.collections.errors.ItemPendingError if the data for that index needs to be
* loaded from a remote location.
*
* @throws RangeError if index < 0
* or index >= length
.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function getItemAt(index:int, prefetch:int = 0):Object;
/**
* 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.
IEventDispatcher
and dispatches a
* PropertyChangeEvent
.
* If a property is specified the view may be able to optimize its
* notification mechanism.
* Otherwise it may choose to simply refresh the whole view.
*
* @param item The item within the view that was updated.
*
* @param property The name of the property that was updated.
*
* @param oldValue The old value of that property. (If property was null,
* this can be the old value of the item.)
*
* @param newValue The new value of that property. (If property was null,
* there's no need to specify this as the item is assumed to be
* the new value.)
*
* @see mx.events.CollectionEvent
* @see mx.events.PropertyChangeEvent
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function itemUpdated(item:Object, property:Object = null,
oldValue:Object = null,
newValue:Object = null):void;
/**
* Removes all items from the list.
*
* If any item is not local and an asynchronous operation must be
* performed, an ItemPendingError
will be thrown.
See the ItemPendingError documentation as well as
* the collections documentation for more information
* on using the ItemPendingError
.
null
if none.
*
* @throws RangeError if index is less than 0 or greater than length.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function setItemAt(item:Object, index:int):Object;
/**
* Returns an Array that is populated in the same order as the IList
* implementation.
* This method can throw an ItemPendingError.
*
* @return The array.
*
* @throws mx.collections.errors.ItemPendingError If the data is not yet completely loaded
* from a remote location.
*
* @langversion 3.0
* @playerversion Flash 9
* @playerversion AIR 1.1
* @productversion Flex 3
*/
function toArray():Array;
}
}