GODPAPER | All Packages | All Classes | Index | Frames No Frames |
Collection

Package | de.polygonal.ds
Interface | public 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

| Property | Defined By
--- | --- | ---
|  | size : int [read-only] The total number of items. | Collection

Public Methods

| Method | Defined By
--- | --- | ---
|  | clear():void Clears all items. | Collection
|  | contains(obj:*):Boolean Determines if the collection contains a given item. | Collection
|  | getIterator():Iterator 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

size | property

`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.

Thu Jan 16 2014, 01:11 PM +08:00