Collection<T>
Defined in: bcl/collection.mts:2
A collection of items compatible with C# ICollection<T>.
Extended by
Type Parameters
T
T
Constructors
Constructor
new Collection<T>(items?): Collection<T>;Defined in: bcl/collection.mts:5
Parameters
items?
Iterable<T, any, any>
Returns
Collection<T>
Properties
items
protected readonly items: T[];Defined in: bcl/collection.mts:3
Accessors
count
Get Signature
get count(): number;Defined in: bcl/collection.mts:10
Number of items in the collection.
Returns
number
Methods
[iterator]()
iterator: IterableIterator<T>;Defined in: bcl/collection.mts:43
Returns
IterableIterator<T>
add()
add(item): void;Defined in: bcl/collection.mts:15
Adds the specified item to the collection.
Parameters
item
T
Returns
void
clear()
clear(): void;Defined in: bcl/collection.mts:29
Removes all items from the collection.
Returns
void
contains()
contains(item): boolean;Defined in: bcl/collection.mts:34
Whether the collection contains the specified item.
Parameters
item
T
Returns
boolean
copy()
copy(): T[];Defined in: bcl/collection.mts:39
Returns a fresh array with a snapshot of the current items.
Returns
T[]
remove()
remove(item): boolean;Defined in: bcl/collection.mts:21
Removes the first occurrence of the specified item from the collection.
Parameters
item
T
Returns
boolean
true when the item was removed; false when it wasn't found.