| Package | com.yworks.canvas.model |
| Class | public class DefaultCollectionModel |
| Inheritance | DefaultCollectionModel flash.events.EventDispatcher |
| Implements | ICollectionModel |
ICollectionModel
that is backed by an ordinary Collection
| Method | Defined by | ||
|---|---|---|---|
|
DefaultCollectionModel(items:Collection = null)
Creates a new instance using a provided collection as the backing store.
| DefaultCollectionModel | ||
|
addAll(collection:Collection):void
Adds all of the elements in the specified collection to this collection (optional operation).
| DefaultCollectionModel | ||
|
addItem(item:Object):Boolean
Adds the specified item to this collection.
| DefaultCollectionModel | ||
|
clear():void
Removes all of the elements from this collection.
| DefaultCollectionModel | ||
|
contains(item:Object):Boolean
Returns true if this collection contains the specified element.
| DefaultCollectionModel | ||
|
getItemAt(index:int):Object
Returns the element at the specified position in this collection.
| DefaultCollectionModel | ||
|
isEmpty():Boolean
Returns true if this collection contains no elements.
| DefaultCollectionModel | ||
|
Returns an iterator over a set of elements.
| DefaultCollectionModel | ||
|
length():uint
Returns the number of elements in this collection.
| DefaultCollectionModel | ||
|
onItemAdded(item:Object):void
Callback method that will trigger the
collectionChange
event. | DefaultCollectionModel | ||
|
onItemChanged(item:Object):void
Callback method that will trigger the
collectionChange
event. | DefaultCollectionModel | ||
|
onItemRemoved(item:Object):void
Callback method that will trigger the
collectionChange
event. | DefaultCollectionModel | ||
|
removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation).
| DefaultCollectionModel | ||
|
toArray():Array
Returns an array containing all of the elements in this collection.
| DefaultCollectionModel | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when an item has been added, removed or changed. | DefaultCollectionModel | |||
| DefaultCollectionModel | () | constructor |
public function DefaultCollectionModel(items:Collection = null)Creates a new instance using a provided collection as the backing store.
Creates a new collection if none is provides.
Parametersitems:Collection (default = null) — The collection to use.
|
| addAll | () | method |
public function addAll(collection:Collection):voidAdds all of the elements in the specified collection to this collection (optional operation).
Parameterscollection:Collection — the collection containing elements to be added to this collection
|
| addItem | () | method |
public function addItem(item:Object):BooleanAdds the specified item to this collection. Returns true if this collection changed as a result of the call. (Returns false if this collection does not permit duplicates and already contains the specified element.)
Parametersitem:Object — element whose presence in this collection is to be ensured
|
Boolean — true if this collection changed as a result of the call
|
| clear | () | method |
public function clear():voidRemoves all of the elements from this collection. The collection will be empty after this method returns.
| contains | () | method |
public function contains(item:Object):BooleanReturns true if this collection contains the specified element.
Parametersitem:Object — element whose presence in this collection is to be tested
|
Boolean — true if this collection contains the specified element
|
| getItemAt | () | method |
public function getItemAt(index:int):ObjectReturns the element at the specified position in this collection.
Parametersindex:int — the index of the element to return
|
Object — the element at the specified position in this list
|
| isEmpty | () | method |
public function isEmpty():BooleanReturns true if this collection contains no elements.
ReturnsBoolean — true if this collection contains no elements
|
| iterator | () | method |
public function iterator():IteratorReturns an iterator over a set of elements.
ReturnsIterator —
an Iterator.
|
| length | () | method |
public function length():uintReturns the number of elements in this collection.
Returnsuint — the number of elements in this collection
|
| onItemAdded | () | method |
public function onItemAdded(item:Object):void
Callback method that will trigger the collectionChange
event.
item:Object — The item that has just been added to the collection.
|
| onItemChanged | () | method |
public function onItemChanged(item:Object):void
Callback method that will trigger the collectionChange
event.
item:Object — The item that has just been changed.
|
| onItemRemoved | () | method |
public function onItemRemoved(item:Object):void
Callback method that will trigger the collectionChange
event.
item:Object — The item that has just been removed from the collection.
|
| removeItem | () | method |
public function removeItem(item:Object):BooleanRemoves a single instance of the specified element from this collection, if it is present (optional operation).
Parametersitem:Object — element to be removed from this collection, if present
|
Boolean — true if an element was removed as a result of this call
|
| toArray | () | method |
public function toArray():ArrayReturns an array containing all of the elements in this collection.
ReturnsArray — an array containing all of the elements in this collection
|
| collectionChange | event |
mx.event.CollectionEvent
Dispatched when an item has been added, removed or changed.