
## CollectionBase class

Provides the abstract base class for a strongly typed collection.

```js
new CollectionBase()
```

Initializes a new instance of the CollectionBase class with the default initial capacity.

## Methods

| Name | Description |
| --- | --- |
| [add(o)](#add) | Adds an item to the CollectionBase instance. |
| [clear()](#clear) | Removes all objects from the CollectionBase instance. |
| [constructor_overload$1(capacity)](#constructor-overload1) | Initializes a new instance of the CollectionBase class with the specified capacity. |
| [contains(o)](#contains) | Return whether instance contains this object |
| [get(index)](#get) | Get an item at specified position. |
| [getCount()](#getcount) | Gets the number of elements contained in the CollectionBase instance. |
| [indexOf(o)](#indexof) | Determines the index of a specific item in the CollectionBase instance. |
| [iterator()](#iterator) | Returns an enumerator that iterates through the CollectionBase instance. |
| [removeAt(index)](#removeat) | Removes the item at the specified index. |

### add(o) {#add}

Adds an item to the CollectionBase instance.

| Parameter | Type | Description |
| --- | --- | --- |
| o | Object | The Object to add to the CollectionBase instance. |

**Returns:** Number — `Number` The position into which the new element was inserted.

### clear() {#clear}

Removes all objects from the CollectionBase instance.

### constructor_overload$1(capacity) {#constructor-overload1}

Initializes a new instance of the CollectionBase class with the specified capacity.

| Parameter | Type | Description |
| --- | --- | --- |
| capacity | Number | The number of elements that the new list can initially store. |

### contains(o) {#contains}

Return whether instance contains this object

| Parameter | Type | Description |
| --- | --- | --- |
| o | Object | test object |

**Returns:** boolean — `boolean` Whether instance contains this object

### get(index) {#get}

Get an item at specified position.

| Parameter | Type | Description |
| --- | --- | --- |
| index | Number | Specified position index. |

**Returns:** Object — `Object` The item at specified position.

### getCount() {#getcount}

Gets the number of elements contained in the CollectionBase instance.

**Returns:** Number — `Number` The number of elements contained in the CollectionBase instance.

### indexOf(o) {#indexof}

Determines the index of a specific item in the CollectionBase instance.

| Parameter | Type | Description |
| --- | --- | --- |
| o | Object | Determines the index of a specific item in the CollectionBase instance. |

**Returns:** Number — `Number` The index of value if found in the list; otherwise, -1.

### iterator() {#iterator}

Returns an enumerator that iterates through the CollectionBase instance.

**Returns:** Iterator — `Iterator` An iterator for the CollectionBase instance.

### removeAt(index) {#removeat}

Removes the item at the specified index.

| Parameter | Type | Description |
| --- | --- | --- |
| index | Number | The zero-based index of the item to remove. |
