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

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

ParameterTypeDescription
oObjectThe 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.

ParameterTypeDescription
capacityNumberThe number of elements that the new list can initially store.

contains(o)

Return whether instance contains this object

ParameterTypeDescription
oObjecttest object

Returns: boolean — boolean Whether instance contains this object

get(index)

Get an item at specified position.

ParameterTypeDescription
indexNumberSpecified 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.

ParameterTypeDescription
oObjectDetermines 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.

ParameterTypeDescription
indexNumberThe zero-based index of the item to remove.