패키지 | mx.collections |
클래스 | public class ArrayList |
상속 | ArrayList EventDispatcher Object |
구현 | IList, IExternalizable, IPropertyChangeNotifier |
하위 클래스 | Conflicts |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 4 |
런타임 버전: | 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" />
기본 MXML 속성source
속성 | 정의 주체 | ||
---|---|---|---|
constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | ||
length : int [읽기 전용]
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 |
메서드 | 정의 주체 | ||
---|---|---|---|
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
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | ||
Add the specified item to the end of the list. | ArrayList | ||
Add the item at the specified index. | ArrayList | ||
이벤트를 이벤트 흐름으로 전달합니다. | 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 | ||
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void
Notify the view that an item has been updated. | ArrayList | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
Remove all items from the list. | ArrayList | ||
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 | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
Return an Array that is populated in the same order as the IList
implementation. | ArrayList | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
[재정의]
Pretty prints the contents of this ArrayList to a string and returns it. | ArrayList | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object | ||
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher |
메서드 | 정의 주체 | ||
---|---|---|---|
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 |
이벤트 | 요약 | 정의 주체 | ||
---|---|---|---|---|
[브로드캐스트 이벤트] Flash Player 또는 AIR 응용 프로그램이 운영 체제 포커스를 얻어 활성화될 때 전달됩니다. | EventDispatcher | |||
Dispatched when the IList has been updated in some way. | ArrayList | |||
[브로드캐스트 이벤트] Flash Player 또는 AIR 응용 프로그램이 운영 체제 포커스를 잃고 비활성화될 때 전달됩니다. | EventDispatcher |
length | 속성 |
length:int
[읽기 전용] 언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
이 속성은 데이터 바인딩에 대한 소스로 사용할 수 있습니다. 이 속성을 수정하면 collectionChange
이벤트를 전달합니다.
구현
public function get length():int
source | 속성 |
source:Array
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
구현
public function get source():Array
public function set source(value:Array):void
uid | 속성 |
ArrayList | () | 생성자 |
public function ArrayList(source:Array = null)
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수source:Array (default = null ) — The Array to use as a source for the ArrayList.
|
addAll | () | 메서드 |
addAllAt | () | 메서드 |
public function addAllAt(addList:IList, index:int):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
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 | () | 메서드 |
addItemAt | () | 메서드 |
public function addItemAt(item:Object, index:int):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
item:Object — the item to place at the index
| |
index:int — the index at which to place the item
|
오류
RangeError — if index is less than 0 or greater than the length
|
getItemAt | () | 메서드 |
public function getItemAt(index:int, prefetch:int = 0):Object
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Get the item at the specified index.
매개 변수
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
|
오류
Error — if the data for that index needs to be
loaded from a remote location
| |
RangeError — if the index < 0 or index >= length
|
getItemIndex | () | 메서드 |
public function getItemIndex(item:Object):int
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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).
매개 변수
item:Object — the item to find
|
int — the index of the item, -1 if the item is not in the list.
|
itemUpdated | () | 메서드 |
public function itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
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.)
|
관련 API 요소
itemUpdateHandler | () | 메서드 |
protected function itemUpdateHandler(event:PropertyChangeEvent):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
event:PropertyChangeEvent — The event object for the ObjectChange event.
|
removeAll | () | 메서드 |
public function removeAll():void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Remove all items from the list.
removeItem | () | 메서드 |
public function removeItem(item:Object):Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Removes the specified item from this list, should it exist.
매개 변수
item:Object — Object reference to the item that should be removed.
|
Boolean — Boolean indicating if the item was removed.
|
removeItemAt | () | 메서드 |
public function removeItemAt(index:int):Object
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
index:int — The index from which to remove the item.
|
Object — The item that was removed.
|
오류
RangeError — if index < 0 or index >= length.
|
setItemAt | () | 메서드 |
public function setItemAt(item:Object, index:int):Object
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
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
|
오류
RangeError — if index is less than 0 or greater than or equal to length
|
startTrackUpdates | () | 메서드 |
protected function startTrackUpdates(item:Object):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
item:Object — The item passed to the addItemAt() method.
|
stopTrackUpdates | () | 메서드 |
protected function stopTrackUpdates(item:Object):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
매개 변수
item:Object — The item passed to the removeItemAt() method.
|
toArray | () | 메서드 |
public function toArray():Array
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Return an Array that is populated in the same order as the IList implementation.
반환값Array — An Array populated in the same order as the IList
implementation.
|
오류
Error — if the data is not yet completely loaded
from a remote location
|
toString | () | 메서드 |
collectionChange | 이벤트 |
mx.events.CollectionEvent
속성 CollectionEvent.type =
mx.events.CollectionEvent.COLLECTION_CHANGE
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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 |
Tue Jun 12 2018, 03:17 PM Z