Packagede.polygonal.ds
Interfacepublic interface Collection
Implementors Array2, Array3, ArrayedQueue, ArrayedStack, BinarySearchTree, DLinkedList, Graph, HashMap, HashTable, Heap, LinkedQueue, LinkedStack, PriorityQueue, SLinkedList, Set, TreeNode

A 'java-style' collection interface.



Public Properties
 PropertyDefined By
  size : int
[read-only] The total number of items.
Collection
Public Methods
 MethodDefined By
  
clear():void
Clears all items.
Collection
  
contains(obj:*):Boolean
Determines if the collection contains a given item.
Collection
  
Initializes an iterator object pointing to the first item in the collection.
Collection
  
isEmpty():Boolean
Checks if the collection is empty.
Collection
  
toArray():Array
Converts the collection into an array.
Collection
Property Detail
sizeproperty
size:int  [read-only]

The total number of items.


Implementation
    public function get size():int
Method Detail
clear()method
public function clear():void

Clears all items.

contains()method 
public function contains(obj:*):Boolean

Determines if the collection contains a given item.

Parameters

obj:* — The item to search for.

Returns
Boolean — True if the item exists, otherwise false.
getIterator()method 
public function getIterator():Iterator

Initializes an iterator object pointing to the first item in the collection.

Returns
Iterator — An iterator object.
isEmpty()method 
public function isEmpty():Boolean

Checks if the collection is empty.

Returns
Boolean — True if empty, otherwise false.
toArray()method 
public function toArray():Array

Converts the collection into an array.

Returns
Array — An array.