Packagecom.yworks.bridge.util
Interfacepublic interface Collection
Implementors AbstractCollection, YList

Collection is the root of the collection hierarchy.



Public Properties
 PropertyDefined By
  empty : Boolean
[read-only] Answers if this Collection has no elements, a size of zero.
Collection
  length : int
[read-only] Returns a count of how many objects are contained by this collection.
Collection
Public Methods
 MethodDefined By
  
addAll(collection:Collection):Boolean
Attempts to add all of the objects contained in collection to the contents of this collection.
Collection
  
addItem(object:Object):Boolean
Attempts to add object to the contents of this Collection.
Collection
  
clear():void
Removes all elements from this Collection, leaving it empty.
Collection
  
containsAll(collection:Collection):Boolean
Searches this Collection for all objects in the specified Collection.
Collection
  
containsItem(object:Object):Boolean
Searches this Collection for the specified object.
Collection
  
Returns an instance of com.yworks.bridge.util.Iterator that may be used to access the objects contained by this collection.
Collection
  
removeAll(collection:Collection):Boolean
Removes all occurrences in this Collection of each object in the specified Collection.
Collection
  
removeItem(object:Object):Boolean
Removes the first occurrence of the specified object from this Collection.
Collection
  
retainAll(collection:Collection):Boolean
Removes all objects from this Collection that are not also found in the contents of collection.
Collection
  
toArray():Vector.<Object>
Answers a new array containing all elements contained in this Collection.
Collection
  
toArray2(array:Vector.<Object>):Vector.<Object>
Answers an array containing all elements contained in this Collection.
Collection
Property Detail
emptyproperty
empty:Boolean  [read-only]

Answers if this Collection has no elements, a size of zero.


Implementation
    public function get empty():Boolean

See also

lengthproperty 
length:int  [read-only]

Returns a count of how many objects are contained by this collection.


Implementation
    public function get length():int
Method Detail
addAll()method
public function addAll(collection:Collection):Boolean

Attempts to add all of the objects contained in collection to the contents of this collection.

Parameters

collection:Collection — the Collection of objects

Returns
Boolean — true if this Collection is modified, false otherwise

Throws
flash.errors:IllegalOperationError — when adding to this Collection is not supported
 
TypeError — when the class of an object is inappropriate for this Collection
 
IllegalArgumentException — when an object cannot be added to this Collection
addItem()method 
public function addItem(object:Object):Boolean

Attempts to add object to the contents of this Collection.

Parameters

object:Object — the object to add

Returns
Booleantrue if this Collection is modified, false otherwise

Throws
flash.errors:IllegalOperationError — when adding to this Collection is not supported
 
TypeError — when the class of the object is inappropriate for this Collection
 
IllegalArgumentException — when the object cannot be added to this Collection
clear()method 
public function clear():void

Removes all elements from this Collection, leaving it empty.


Throws
flash.errors:IllegalOperationError — when removing from this Collection is not supported

See also

containsAll()method 
public function containsAll(collection:Collection):Boolean

Searches this Collection for all objects in the specified Collection.

Parameters

collection:Collection — the Collection of objects

Returns
Boolean — true if all objects in the specified Collection are elements of this Collection, false otherwise
containsItem()method 
public function containsItem(object:Object):Boolean

Searches this Collection for the specified object.

Parameters

object:Object — the object to search for

Returns
Boolean — true if object is an element of this Collection, false otherwise
iterator()method 
public function iterator():Iterator

Returns an instance of com.yworks.bridge.util.Iterator that may be used to access the objects contained by this collection.

Returns
Iterator — an iterator for accessing the collection contents

See also

removeAll()method 
public function removeAll(collection:Collection):Boolean

Removes all occurrences in this Collection of each object in the specified Collection.

Parameters

collection:Collection — the Collection of objects to remove

Returns
Boolean — true if this Collection is modified, false otherwise

Throws
flash.errors:IllegalOperationError — when removing from this Collection is not supported
removeItem()method 
public function removeItem(object:Object):Boolean

Removes the first occurrence of the specified object from this Collection.

Parameters

object:Object — the object to remove

Returns
Boolean — true if this Collection is modified, false otherwise

Throws
flash.errors:IllegalOperationError — when removing from this Collection is not supported
retainAll()method 
public function retainAll(collection:Collection):Boolean

Removes all objects from this Collection that are not also found in the contents of collection.

Parameters

collection:Collection — the Collection of objects to retain

Returns
Boolean — true if this Collection is modified, false otherwise

Throws
flash.errors:IllegalOperationError — when removing from this Collection is not supported
toArray()method 
public function toArray():Vector.<Object>

Answers a new array containing all elements contained in this Collection.

Returns
Vector.<Object> — an array of the elements from this Collection
toArray2()method 
public function toArray2(array:Vector.<Object>):Vector.<Object>

Answers an array containing all elements contained in this Collection. If the specified array is large enough to hold the elements, the specified array is used, otherwise an array of the same type is created. If the specified array is used and is larger than this Collection, the array element following the collection elements is set to null.

Parameters

array:Vector.<Object> — the array

Returns
Vector.<Object> — an array of the elements from this Collection

Throws
Error — when the type of an element in this Collection cannot be stored in the type of the specified array