패키지 | mx.collections |
클래스 | public class HierarchicalCollectionViewCursor |
상속 | HierarchicalCollectionViewCursor EventDispatcher Object |
구현 | IHierarchicalCollectionViewCursor |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
관련 API 요소
속성 | 정의 주체 | ||
---|---|---|---|
afterLast : Boolean [읽기 전용]
If the cursor is located after the last item in the view,
this property is true . | HierarchicalCollectionViewCursor | ||
beforeFirst : Boolean [읽기 전용]
If the cursor is located before the first item in the view,
this property is true. | HierarchicalCollectionViewCursor | ||
bookmark : CursorBookmark [읽기 전용]
Provides access to a bookmark that corresponds to the item
returned by the current property. | HierarchicalCollectionViewCursor | ||
constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | ||
current : Object [읽기 전용]
Provides access the object at the location
in the source collection referenced by this cursor. | HierarchicalCollectionViewCursor | ||
currentDepth : int [읽기 전용]
Contains the depth of the node at the location
in the source collection referenced by this cursor. | HierarchicalCollectionViewCursor | ||
view : ICollectionView [읽기 전용]
A reference to the ICollectionView with which this cursor is associated. | HierarchicalCollectionViewCursor |
메서드 | 정의 주체 | ||
---|---|---|---|
HierarchicalCollectionViewCursor(collection:HierarchicalCollectionView, model:ICollectionView, hierarchicalData:IHierarchicalData)
Constructor. | HierarchicalCollectionViewCursor | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | ||
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | ||
Finds an item with the specified properties within the collection
and positions the cursor to that item. | HierarchicalCollectionViewCursor | ||
Finds the first item with the specified properties within the collection
and positions the cursor to that item. | HierarchicalCollectionViewCursor | ||
Finds the last item with the specified properties within the collection
and positions the cursor on that item. | HierarchicalCollectionViewCursor | ||
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Inserts the specified item before the cursor's current position. | HierarchicalCollectionViewCursor | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
Moves the cursor to the next item within the collection. | HierarchicalCollectionViewCursor | ||
Moves the cursor to the previous item within the collection. | HierarchicalCollectionViewCursor | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
Removes the current item and returns it. | HierarchicalCollectionViewCursor | ||
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | ||
Moves the cursor to a location at an offset from the specified
bookmark. | HierarchicalCollectionViewCursor | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object | ||
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher |
afterLast | 속성 |
beforeFirst | 속성 |
bookmark | 속성 |
bookmark:CursorBookmark
[읽기 전용] 언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Provides access to a bookmark that corresponds to the item
returned by the current
property.
The bookmark can be used to move the cursor
to a previously visited item, or to a position relative to that item.
(See the seek()
method for more information.)
구현
public function get bookmark():CursorBookmark
current | 속성 |
current:Object
[읽기 전용] 언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Provides access the object at the location
in the source collection referenced by this cursor.
If the cursor is beyond the ends of the collection
(beforeFirst
, afterLast
)
this will return null
.
구현
public function get current():Object
currentDepth | 속성 |
currentDepth:int
[읽기 전용] 언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Contains the depth of the node at the location in the source collection referenced by this cursor. If the cursor is beyond the end of the collection, this property contains 0.
구현
public function get currentDepth():int
view | 속성 |
view:ICollectionView
[읽기 전용] 언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
A reference to the ICollectionView with which this cursor is associated.
구현
public function get view():ICollectionView
HierarchicalCollectionViewCursor | () | 생성자 |
public function HierarchicalCollectionViewCursor(collection:HierarchicalCollectionView, model:ICollectionView, hierarchicalData:IHierarchicalData)
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Constructor.
매개 변수collection:HierarchicalCollectionView — The HierarchicalCollectionView instance referenced by this cursor.
| |
model:ICollectionView — The source data collection.
| |
hierarchicalData:IHierarchicalData — The data used to create the HierarchicalCollectionView instance.
|
findAny | () | 메서드 |
public function findAny(values:Object):Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Finds an item with the specified properties within the collection and positions the cursor to that item. If the item can not be found, the cursor location does not change.
The findAny()
method can only be called on sorted views;
if the view isn't sorted, a CursorError
is thrown.
If the associated collection is remote, and not all of the items have been cached locally, this method begins an asynchronous fetch from the remote collection. If one is already in progress, this method waits for it to complete before making another fetch request.
If multiple items can match the search criteria then the item found
is non-deterministic.
If it is important to find the first or last occurrence of an item
in a non-unique index, use the findFirst()
or
findLast()
method.
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown.
매개 변수
values:Object — The search criteria. The values in the Object must be configured as name-value pairs,
as in an associative array (or be the actual object to search for). The values of the names specified must match properties
specified in the sort. For example, if properties x , y , and
z are in the current sort, the values specified should be
{x: x-value, y: y-value, z: z-value} .
|
Boolean — When all of the data is local this method returns
true if the item can be found and false
otherwise.
|
findFirst | () | 메서드 |
public function findFirst(values:Object):Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Finds the first item with the specified properties within the collection and positions the cursor to that item. If the item can not be found, no cursor location does not change.
The findFirst()
method can only be called on sorted views;
if the view isn't sorted, a CursorError
is thrown.
If the associated collection is remote, and not all of the items have been cached locally, this method begins an asynchronous fetch from the remote collection. If one is already in progress, this method waits for it to complete before making another fetch request.
If it is not important to find the first occurrence of an item
in a non-unique index, use findAny()
, which may be
a little faster than the findFirst() method
.
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown.
매개 변수
values:Object — The search criteria. The values in the Object must be configured as name-value pairs,
as in an associative array (or be the actual object to search for). The values of the names specified must match properties
specified in the sort. For example, if properties x , y , and
z are in the current sort, the values specified should be
{x: x-value, y: y-value, z: z-value} .
|
Boolean — When all of the data is local this method returns
true if the item can be found and false
otherwise.
|
findLast | () | 메서드 |
public function findLast(values:Object):Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Finds the last item with the specified properties within the collection and positions the cursor on that item. If the item can not be found, the cursor location does not chanage.
The findLast()
method can only be called on sorted views;
if the view isn't sorted, a CursorError
is thrown.
If the associated collection is remote, and not all of the items have been cached locally, this method begins an asynchronous fetch from the remote collection. If one is already in progress, this method waits for it to complete before making another fetch request.
If it is not important to find the last occurrence of an item
in a non-unique index, use the findAny()
method, which
may be a little faster.
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown.
매개 변수
values:Object — The search criteria. The values in the Object must be configured as name-value pairs,
as in an associative array (or be the actual object to search for). The values of the names specified must match properties
specified in the sort. For example, if properties x , y , and
z are in the current sort, the values specified should be
{x: x-value, y: y-value, z: z-value} .
|
Boolean — When all of the data is local this method returns
true if the item can be found and false
otherwise.
|
insert | () | 메서드 |
public function insert(item:Object):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Inserts the specified item before the cursor's current position.
If the cursor is afterLast
,
the insertion occurs at the end of the view.
If the cursor is beforeFirst
on a non-empty view,
an error is thrown.
매개 변수
item:Object — The item to insert before the cursor's current position.
|
moveNext | () | 메서드 |
public function moveNext():Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Moves the cursor to the next item within the collection.
On success the current
property is updated
to reference the object at this new location.
Returns true
if the resulting current
property is valid, or false
if not
(the property value is afterLast
).
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown. See the ItemPendingError documentation and the collections documentation for more information on using the ItemPendingError.
반환값Boolean — true if still in the list,
false if the current value initially was
or now is afterLast .
|
movePrevious | () | 메서드 |
public function movePrevious():Boolean
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Moves the cursor to the previous item within the collection.
On success the current
property is updated
to reference the object at this new location.
Returns true
if the resulting current
property is valid, or false
if not
(the property value is beforeFirst
).
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown. See the ItemPendingError documentation and the collections documentation for more information on using the ItemPendingError.
반환값Boolean — true if still in the list,
false if the current value initially was or
now is beforeFirst .
For example:
var myArrayCollection:ICollectionView = new ArrayCollection([ "Bobby", "Mark", "Trevor", "Jacey", "Tyler" ]); var cursor:IViewCursor = myArrayCollection.createCursor(); cursor.seek(CursorBookmark.last); while (!cursor.beforeFirst) { trace(current); cursor.movePrevious(); } |
remove | () | 메서드 |
public function remove():Object
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Removes the current item and returns it.
If the cursor location is beforeFirst
or
afterLast
, throws a CursorError.
If you remove any item other than the last item,
the cursor moves to the next item. If you remove the last item, the
cursor is at the AFTER_LAST bookmark.
If the item after the removed item is not local and an asynchronous operation must be performed, an ItemPendingError is thrown. See the ItemPendingError documentation and the collections documentation for more information on using the ItemPendingError.
반환값Object — The item that was removed.
|
seek | () | 메서드 |
public function seek(bookmark:CursorBookmark, offset:int = 0, prefetch:int = 0):void
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | Flash Player 9, AIR 1.1 |
Moves the cursor to a location at an offset from the specified
bookmark.
The offset can be negative, in which case the cursor is positioned
an offset
number of items prior to the specified bookmark.
If the associated collection is remote, and not all of the items have been cached locally, this method begins an asynchronous fetch from the remote collection.
If the data is not local and an asynchronous operation must be performed, an ItemPendingError is thrown. See the ItemPendingError documentation and the collections documentation for more information on using the ItemPendingError.
매개 변수
bookmark:CursorBookmark — CursorBookmark reference to marker
information that allows repositioning to a specific location.
You can set this parameter to value returned from the
bookmark property, or to one of the following constant
bookmark values:
| |
offset:int (default = 0 ) — Indicates how far from the specified bookmark to seek.
If the specified number is negative, the cursor attempts to
move prior to the specified bookmark.
If the offset specified is beyond the end of the collection,
the cursor is be positioned off the end, to the
beforeFirst or afterLast location.
| |
prefetch:int (default = 0 ) — Used for remote data. Indicates an intent to iterate
in a specific direction once the seek operation completes.
This reduces the number of required network round trips during a seek.
If the iteration direction is known at the time of the request,
the appropriate amount of data can be returned ahead of the request
to iterate it.
|
Tue Jun 12 2018, 03:17 PM Z