class · System
List<T>
public class System.List<T> : System.Any
- Tipo
- class
- Espacio de nombres
- System
- Ensamblado
- System.Core
- Acceso
- public
- Archivo fuente
List.ant
Parámetros de tipo
| Nombre | Restricciones |
|---|---|
T | cualquier tipo |
Herencia
- Clases base
-
AnyList<T>
Constructores
Propiedades
Métodos
method Add(item: T) -> void
#
Adds item at the end.
The item at index (list[index]).
Replaces the item at index (list[index] = item).
Puts item at index, moving the rest one place on.
Takes out the item at index and gives it.
method Pop() -> T
#
The last item, taken out.
method Clear() -> void
#
Empties the list (the vacated slots hold no references, so their objects can be collected).
method ToArray() -> T[]
#
The items in a new array.
method AddRange(other: System.List<T>) -> void
#
Adds every item of other at the end.
method Reverse() -> void
#
The items in reverse order, in place.
method GetRange(start: i32, length: i32) -> System.List<T>
#
A new list with length items from start.
Sorts the items in place by order (negative: a goes first; not stable).
method Where(match: func<T> : bool) -> System.List<T>
#
A new list with the items match accepts, in order.
method Select<R>(convert: func<T> : R) -> System.List<R>
#
A new list with convert of each item.
Whether some item is accepted by match.
Whether every item is accepted by match.
How many items match accepts.
Where the first item that match accepts is, or -1.
The first item that match accepts (InvalidOperationError when there is none).
method ForEach(action: func<T> : void) -> void
#
Runs action on each item, in order.
Takes out every item match accepts; how many it took.
method Aggregate<A>(seed: A, combine: func<A, T> : A) -> A
#
seed combined with each item in turn (Aggregate(0, (sum, x) => sum + x)).
method Items() -> T[]
#
The array the items are kept in (its first Count elements are the items; shared, not copied).
method Iterator() -> System.ListIterator<T>
#
loop (T item in list) (over the items the list has when the loop starts).
Miembros privados e internos (3)
Miembros heredados (5)
GetTypemétodo de AnyUndescribedmétodo de AnyToStringmétodo de AnyHashmétodo de Anydestroymétodo de Any
Código fuente
List<T> en Larva HIR, descompilado a partir de su Larva HIR.
public class System.List<T> : System.Any
{
field items: T[]
field count: i32
method Grow(needed: i32) -> void
constructor List()
constructor List(capacity: i32)
// Adds `item` at the end.
method Add(item: T) -> void
// The item at `index` (`list[index]`).
method At(index: i32) -> T
// Replaces the item at `index` (`list[index] = item`).
method SetAt(index: i32, item: T) -> void
// Puts `item` at `index`, moving the rest one place on.
method Insert(index: i32, item: T) -> void
// Takes out the item at `index` and gives it.
method RemoveAt(index: i32) -> T
// The last item, taken out.
method Pop() -> T
// Empties the list (the vacated slots hold no references, so their objects can be collected).
method Clear() -> void
// The items in a new array.
method ToArray() -> T[]
// Adds every item of `other` at the end.
method AddRange(other: System.List<T>) -> void
// The items in reverse order, in place.
method Reverse() -> void
// A new list with `length` items from `start`.
method GetRange(start: i32, length: i32) -> System.List<T>
// Sorts the items in place by `order` (negative: a goes first; not stable).
method Sort(order: func<T, T> : i32) -> void
// A new list with the items `match` accepts, in order.
method Where(match: func<T> : bool) -> System.List<T>
// A new list with `convert` of each item.
method Select<R>(convert: func<T> : R) -> System.List<R>
// Whether some item is accepted by `match`.
method Any(match: func<T> : bool) -> bool
// Whether every item is accepted by `match`.
method All(match: func<T> : bool) -> bool
// How many items `match` accepts.
method CountWhere(match: func<T> : bool) -> i32
// Where the first item that `match` accepts is, or -1.
method FindIndex(match: func<T> : bool) -> i32
// The first item that `match` accepts (InvalidOperationError when there is none).
method First(match: func<T> : bool) -> T
// Runs `action` on each item, in order.
method ForEach(action: func<T> : void) -> void
// Takes out every item `match` accepts; how many it took.
method RemoveAll(match: func<T> : bool) -> i32
// `seed` combined with each item in turn (`Aggregate(0, (sum, x) => sum + x)`).
method Aggregate<A>(seed: A, combine: func<A, T> : A) -> A
// The array the items are kept in (its first Count elements are the items; shared, not copied).
method Items() -> T[]
// `loop (T item in list)` (over the items the list has when the loop starts).
method Iterator() -> System.ListIterator<T>
property Count: i32
property IsEmpty: bool
}