Packagecom.yworks.util
Classpublic class CompositeCollectionModel
InheritanceCompositeCollectionModel Inheritance com.yworks.support.EventDispatchingProxy
Implements ICollectionModel
Subclasses WrappingCollectionModel

A ICollectionModel implementation that is the composite of two models.

This class also lets you use [ ] array notation to access the getItemAt() method. Writing is not supported.

The for each..in loop is also supported. Please note that depending on the collections this model is composed of, iterating with for each..in may be considerably slower than iterating using the Iterator returned by the iterator() method.

See also

ICollectionModel


Public Methods
 MethodDefined By
  
Constructor takes the two models.
CompositeCollectionModel
  
addAll(iter:Iterable):void
This implementation does not allow to add or remove items.
CompositeCollectionModel
  
addItem(item:Object):Boolean
This implementation does not allow to add or remove items.
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
This implementation does not allow to add or remove items.
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(iter:Iterable):void

This implementation does not allow to add or remove items.

Parameters

iter:Iterable

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

This implementation does not allow to add or remove items.

Parameters

item:Object

Returns
Boolean
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

This implementation does not allow to add or remove items.

Parameters

item:Object

Returns
Boolean
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