Packagecom.yworks.util
Classpublic class CompositeCollectionModel
InheritanceCompositeCollectionModel Inheritance flash.events.EventDispatcher
ImplementsICollectionModel

A ICollectionModel implementation that is the composite of two models.

See also

ICollectionModel


Public Methods
 MethodDefined by
  
Constructor takes the two models.
CompositeCollectionModel
  
addAll(collection:Collection):void
Adds all of the elements in the specified collection to this collection (optional operation).
CompositeCollectionModel
  
addItem(item:Object):Boolean
Adds the specified item to this collection.
CompositeCollectionModel
  
clear():void
Removes all of the elements from this collection.
CompositeCollectionModel
  
contains(item:Object):Boolean
Returns true if this collection contains the specified element.
CompositeCollectionModel
  
dispose():void
CompositeCollectionModel
  
getItemAt(index:int):Object
Returns the element at the specified position in this collection.
CompositeCollectionModel
  
isEmpty():Boolean
CompositeCollectionModel
  
Returns an iterator over a set of elements.
CompositeCollectionModel
  
length():uint
Returns the number of elements in this collection.
CompositeCollectionModel
  
removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation).
CompositeCollectionModel
  
toArray():Array
Returns an array containing all of the elements in this collection.
CompositeCollectionModel
Constructor detail
CompositeCollectionModel()constructor
public function CompositeCollectionModel(collection1:ICollectionModel, collection2:ICollectionModel)

Constructor takes the two models.

Parameters
collection1:ICollectionModel — A model.
 
collection2:ICollectionModel — Another model.
Method detail
addAll()method
public function addAll(collection:Collection):void

Adds all of the elements in the specified collection to this collection (optional operation).

Parameters
collection:Collection — the collection containing elements to be added to this collection
addItem()method 
public function addItem(item:Object):Boolean

Adds 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.)

Parameters
item:Object — element whose presence in this collection is to be ensured

Returns
Boolean — true if this collection changed as a result of the call
clear()method 
public function clear():void

Removes all of the elements from this collection. The collection will be empty after this method returns.

contains()method 
public function contains(item:Object):Boolean

Returns true if this collection contains the specified element.

Parameters
item:Object — element whose presence in this collection is to be tested

Returns
Boolean — true if this collection contains the specified element
dispose()method 
public function dispose():void

getItemAt()method 
public function getItemAt(index:int):Object

Returns the element at the specified position in this collection.

Parameters
index:int — the index of the element to return

Returns
Object — the element at the specified position in this list
isEmpty()method 
public function isEmpty():Boolean

Returns
Boolean
iterator()method 
public function iterator():Iterator

Returns an iterator over a set of elements.

Returns
Iterator — an Iterator.
length()method 
public function length():uint

Returns the number of elements in this collection.

Returns
uint — the number of elements in this collection
removeItem()method 
public function removeItem(item:Object):Boolean

Removes a single instance of the specified element from this collection, if it is present (optional operation).

Parameters
item:Object — element to be removed from this collection, if present

Returns
Boolean — true if an element was removed as a result of this call
toArray()method 
public function toArray():Array

Returns an array containing all of the elements in this collection.

Returns
Array — an array containing all of the elements in this collection