Pakket | mx.collections |
Klasse | public class ArrayList |
Overerving | ArrayList EventDispatcher Object |
Implementatie | IList, IExternalizable, IPropertyChangeNotifier |
Subklassen | Conflicts |
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 4 |
Runtimeversies: | Flash Player 10, AIR 1.5 |
IList
interface. Operations on an ArrayList instance modify the
data source; for example, if you use the removeItemAt()
method on an ArrayList, you remove the item from the underlying
Array.
This base class will not throw ItemPendingErrors but it
is possible that a subclass might.
<mx:ArrayList Properties source="null" />
Standaard-MXML-eigenschapsource
Eigenschap | Gedefinieerd door | ||
---|---|---|---|
constructor : Object
Verwijzing naar het klasseobject of de constructorfunctie van een bepaalde objectinstantie. | Object | ||
length : int [alleen-lezen]
Get the number of items in the list. | ArrayList | ||
source : Array
The source array for this ArrayList. | ArrayList | ||
uid : String
Provides access to the unique id for this list. | ArrayList |
Methode | Gedefinieerd door | ||
---|---|---|---|
Construct a new ArrayList using the specified array as its source. | ArrayList | ||
Adds a list of items to the current list, placing them at the end of
the list in the order they are passed. | ArrayList | ||
Adds a list of items to the current list, placing them at the position
index passed in to the function. | ArrayList | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registreert een gebeurtenislistenerobject bij een object EventDispatcher, zodat de listener een melding van een gebeurtenis ontvangt. | EventDispatcher | ||
Add the specified item to the end of the list. | ArrayList | ||
Add the item at the specified index. | ArrayList | ||
Verzendt een gebeurtenis naar de gebeurtenisstroom. | EventDispatcher | ||
Get the item at the specified index. | ArrayList | ||
Return the index of the item if it is in the list such that
getItemAt(index) == item. | ArrayList | ||
Controleert of het object EventDispatcher listeners heeft geregistreerd voor een specifiek type gebeurtenis. | EventDispatcher | ||
Geeft aan of voor een object een opgegeven eigenschap is gedefinieerd. | Object | ||
Geeft aan of een instantie van de klasse Object zich in de prototypeketen van het object bevindt dat als parameter is opgegeven. | Object | ||
itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void
Notify the view that an item has been updated. | ArrayList | ||
Geeft aan of de opgegeven eigenschap bestaat en kan worden opgesomd. | Object | ||
Remove all items from the list. | ArrayList | ||
Verwijdert een listener uit het object EventDispatcher. | EventDispatcher | ||
Removes the specified item from this list, should it exist. | ArrayList | ||
Remove the item at the specified index and return it. | ArrayList | ||
Place the item at the specified index. | ArrayList | ||
Stelt de beschikbaarheid van een dynamische eigenschap voor lusbewerkingen in. | Object | ||
Return an Array that is populated in the same order as the IList
implementation. | ArrayList | ||
Geeft de tekenreeksweergave van dit object weer, geformatteerd volgens de locatiespecifieke conventies. | Object | ||
[overschrijven]
Pretty prints the contents of this ArrayList to a string and returns it. | ArrayList | ||
Retourneert de primitieve waarde van het opgegeven object. | Object | ||
Controleert of een gebeurtenislistener is geregistreerd bij dit object EventDispatcher of een van de voorouders voor het opgegeven type gebeurtenis. | EventDispatcher |
Methode | Gedefinieerd door | ||
---|---|---|---|
Called when any of the contained items in the list dispatch an
ObjectChange event. | ArrayList | ||
If the item is an IEventDispatcher, watch it for updates. | ArrayList | ||
If the item is an IEventDispatcher, stop watching it for updates. | ArrayList |
Gebeurtenis | Overzicht | Gedefinieerd door | ||
---|---|---|---|---|
[uitgezonden gebeurtenis] Wordt verzonden wanneer Flash Player of de AIR-toepassing de besturingssysteemfocus krijgt en actief wordt. | EventDispatcher | |||
Dispatched when the IList has been updated in some way. | ArrayList | |||
[uitgezonden gebeurtenis] Wordt verzonden wanneer Flash Player of de AIR-toepassing de systeemfocus verliest en inactief wordt. | EventDispatcher |
length | eigenschap |
length:int
[alleen-lezen] Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Get the number of items in the list. An ArrayList should always know its length so it shouldn't return -1, though a subclass may override that behavior.
Deze eigenschap kan als de bron voor gegevensbinding worden gebruikt. Wanneer deze eigenschap wordt gewijzigd, wordt de gebeurtenis collectionChange
verzonden.
Implementatie
public function get length():int
source | eigenschap |
source:Array
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
The source array for this ArrayList.
Any changes done through the IList interface will be reflected in the
source array.
If no source array was supplied the ArrayList will create one internally.
Changes made directly to the underlying Array (e.g., calling
theList.source.pop()
will not cause CollectionEvents
to be dispatched.
Implementatie
public function get source():Array
public function set source(value:Array):void
uid | eigenschap |
ArrayList | () | Constructor |
public function ArrayList(source:Array = null)
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Construct a new ArrayList using the specified array as its source. If no source is specified an empty array will be used.
Parameterssource:Array (default = null ) — The Array to use as a source for the ArrayList.
|
addAll | () | methode |
public function addAll(addList:IList):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Adds a list of items to the current list, placing them at the end of the list in the order they are passed.
Parameters
addList:IList — The list of items to add to the current list
|
addAllAt | () | methode |
public function addAllAt(addList:IList, index:int):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Adds a list of items to the current list, placing them at the position index passed in to the function. The items are placed at the index location and placed in the order they are recieved.
Parameters
addList:IList — The list of items to add to the current list
| |
index:int — The location of the current list to place the new items.
|
addItem | () | methode |
addItemAt | () | methode |
public function addItemAt(item:Object, index:int):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Add the item at the specified index. Any item that was after this index is moved out by one.
Parameters
item:Object — the item to place at the index
| |
index:int — the index at which to place the item
|
Gegenereerde uitzondering
RangeError — if index is less than 0 or greater than the length
|
getItemAt | () | methode |
public function getItemAt(index:int, prefetch:int = 0):Object
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Get the item at the specified index.
Parameters
index:int — the index in the list from which to retrieve the item
| |
prefetch:int (default = 0 ) — int indicating both the direction and amount of items
to fetch during the request should the item not be local.
|
Object — the item at that index, null if there is none
|
Gegenereerde uitzondering
Error — if the data for that index needs to be
loaded from a remote location
| |
RangeError — if the index < 0 or index >= length
|
getItemIndex | () | methode |
public function getItemIndex(item:Object):int
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Return the index of the item if it is in the list such that getItemAt(index) == item. Note that in this implementation the search is linear and is therefore O(n).
Parameters
item:Object — the item to find
|
int — the index of the item, -1 if the item is not in the list.
|
itemUpdated | () | methode |
public function itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Notify the view that an item has been updated.
This is useful if the contents of the view do not implement
IEventDispatcher
.
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.
Parameters
item:Object — The item within the view that was updated.
| |
property:Object (default = null ) — A String, QName, or int
specifying the property that was updated.
| |
oldValue:Object (default = null ) — The old value of that property.
(If property was null, this can be the old value of the item.)
| |
newValue:Object (default = null ) — 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.)
|
Verwante API-elementen
itemUpdateHandler | () | methode |
protected function itemUpdateHandler(event:PropertyChangeEvent):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Called when any of the contained items in the list dispatch an
ObjectChange event.
Wraps it in a CollectionEventKind.UPDATE
object.
Parameters
event:PropertyChangeEvent — The event object for the ObjectChange event.
|
removeAll | () | methode |
public function removeAll():void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Remove all items from the list.
removeItem | () | methode |
public function removeItem(item:Object):Boolean
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Removes the specified item from this list, should it exist.
Parameters
item:Object — Object reference to the item that should be removed.
|
Boolean — Boolean indicating if the item was removed.
|
removeItemAt | () | methode |
public function removeItemAt(index:int):Object
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Remove the item at the specified index and return it. Any items that were after this index are now one index earlier.
Parameters
index:int — The index from which to remove the item.
|
Object — The item that was removed.
|
Gegenereerde uitzondering
RangeError — if index < 0 or index >= length.
|
setItemAt | () | methode |
public function setItemAt(item:Object, index:int):Object
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Place the item at the specified index. If an item was already at that index the new item will replace it and it will be returned.
Parameters
item:Object — the new value for the index
| |
index:int — the index at which to place the item
|
Object — the item that was replaced, null if none
|
Gegenereerde uitzondering
RangeError — if index is less than 0 or greater than or equal to length
|
startTrackUpdates | () | methode |
protected function startTrackUpdates(item:Object):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
If the item is an IEventDispatcher, watch it for updates.
This method is called by the addItemAt()
method,
and when the source is initially assigned.
Parameters
item:Object — The item passed to the addItemAt() method.
|
stopTrackUpdates | () | methode |
protected function stopTrackUpdates(item:Object):void
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
If the item is an IEventDispatcher, stop watching it for updates.
This method is called by the removeItemAt()
and
removeAll()
methods, and before a new
source is assigned.
Parameters
item:Object — The item passed to the removeItemAt() method.
|
toArray | () | methode |
public function toArray():Array
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Return an Array that is populated in the same order as the IList implementation.
Geretourneerde waardeArray — An Array populated in the same order as the IList
implementation.
|
Gegenereerde uitzondering
Error — if the data is not yet completely loaded
from a remote location
|
toString | () | methode |
collectionChange | Gebeurtenis |
mx.events.CollectionEvent
eigenschap CollectionEvent.type =
mx.events.CollectionEvent.COLLECTION_CHANGE
Taalversie: | ActionScript 3.0 |
Productversie: | Flex 3 |
Runtimeversies: | Flash Player 9, AIR 1.1 |
Dispatched when the IList has been updated in some way.
The CollectionEvent.COLLECTION_CHANGE constant defines the value of thetype
property of the event object for an event that is
dispatched when a collection has changed.
The properties of the event object have the following values. Not all properties are meaningful for all kinds of events. See the detailed property descriptions for more information.
Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
items | An Array of objects with
information about the items affected by the event.
The contents of this field depend on the event kind;
for details see the items property |
kind | The kind of event. The valid values are defined in the CollectionEventKind class as constants. |
location | Location within the target collection
of the item(s) specified in the items property. |
oldLocation | the previous location in the collection
of the item specified in the items property. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
type | CollectionEvent.COLLECTION_CHANGE |
Wed Jun 13 2018, 11:42 AM Z