Packagecom.yworks.support
Interfacepublic interface Collection extends Iterable
Implementors BendList, HashSet

A collection of data.



Public Methods
 MethodDefined By
  
addAll(iterable:Iterable):void
Adds all of the elements in the specified collection to this collection (optional operation).
Collection
  
addItem(item:Object):Boolean
Adds the specified item to this collection.
Collection
  
clear():void
Removes all of the elements from this collection.
Collection
  
contains(item:Object):Boolean
Returns true if this collection contains the specified element.
Collection
  
getItemAt(index:int):Object
Returns the element at the specified position in this collection.
Collection
  
isEmpty():Boolean
Returns true if this collection contains no elements.
Collection
 Inherited
Returns an iterator over a set of elements.
Iterable
  
length():uint
Returns the number of elements in this collection.
Collection
  
removeItem(item:Object):Boolean
Removes a single instance of the specified element from this collection, if it is present (optional operation).
Collection
  
toArray():Array
Returns an array containing all of the elements in this collection.
Collection
Method Detail
addAll()method
public function addAll(iterable:Iterable):void

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

Parameters

iterable:Iterable — 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
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 true if this collection contains no elements.

Returns
Boolean — true if this collection contains no elements
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