ArrayList<G>
Last updated
Was this helpful?
Last updated
Was this helpful?
Реализация массива изменяемого размера c интерфейсом .
Массив автоматически увеличивается при необходимости.
Compile and Run
You can use any type fitting into the size of a pointer (e.g. int, bool, reference types) directly as generic type argument: <bool>, <int>, <string>, <MyObject>. Other types must be "boxed" by appending a question mark: <float?>, <double?>, <MyStruct?>. The compiler will tell you this if necessary.
Эта реализация хороша для редко изменяемых данных. Поскольку данные хранятся в массиве, эта структура не подходит для сильно изменяемых данных. альтернативная реализация см. .
public <> { get; } The elements' equality testing function.
public override { get; } Specifies whether this collection can change - i.e. wheather , etc. are legal operations.
public override { get; } The number of items in this collection.
public (owned <>? equal_func = null) Constructs a new, empty array list.
public (owned [] items, owned <>? equal_func = null) Constructs a new array list based on provided array.
public override (<> f)
public override ( index) Returns the item at the specified index in this list.
public override void ( index, item) Sets the item at the specified index in this list.
public override ( item) Adds an item to this collection. Must not be called on read-only collections.
public (<> collection)
public override <> () Returns a BidirListIterator that can be used for iteration over this list.
public override void () Removes all items from this collection. Must not be called on read-only collections.
public override ( item) Determines whether this collection contains the specified item.
public override ( item) Returns the index of the first occurence of the specified item in this list.
public override void ( index, item) Inserts an item into this list at the specified position.
public override <> () Returns a that can be used for simple iteration over a collection.
public override <> () Returns a ListIterator that can be used for iteration over this list.
public override ( item) Removes the first occurence of an item from this collection. Must not be called on read-only collections.
public override ( index) Removes the item at the specified index of this list.
public override <>? ( start, stop) Returns a slice of this list.
Полный список коллекций см .