CollectionBase
CollectionBase class
Provides the abstract base class for a strongly typed collection.
new CollectionBase()
Initializes a new instance of the CollectionBase class with the default initial capacity.
Methods
| Name | Description |
|---|---|
| add(o) | Adds an item to the CollectionBase instance. |
| clear() | Removes all objects from the CollectionBase instance. |
| constructor_overload$1(capacity) | Initializes a new instance of the CollectionBase class with the specified capacity. |
| contains(o) | Return whether instance contains this object |
| get(index) | Get an item at specified position. |
| getCount() | Gets the number of elements contained in the CollectionBase instance. |
| indexOf(o) | Determines the index of a specific item in the CollectionBase instance. |
| iterator() | Returns an enumerator that iterates through the CollectionBase instance. |
| removeAt(index) | Removes the item at the specified index. |
add(o)
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()
Removes all objects from the CollectionBase instance.
constructor_overload$1(capacity)
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)
Return whether instance contains this object
| Parameter | Type | Description |
|---|---|---|
| o | Object | test object |
Returns: boolean — boolean Whether instance contains this object
get(index)
Get an item at specified position.
| Parameter | Type | Description |
|---|---|---|
| index | Number | Specified position index. |
Returns: Object — Object The item at specified position.
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)
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()
Returns an enumerator that iterates through the CollectionBase instance.
Returns: Iterator — Iterator An iterator for the CollectionBase instance.
removeAt(index)
Removes the item at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | Number | The zero-based index of the item to remove. |