Collection Classes
- slide 12 : 36
Overview of the class
List<T>
The class
List<T>
offers a
comprehensive repertoire
of list operations
Tree of generic list types
Similar overview of
Collection<T>
Members of the class
List<T>
Constructors
List()
,
List(
IEnumerable<T>
)
,
List(int)
Via a
collection initializer
:
new
List<T>
{t1, t2, ..., tn}
Element access
this
[int]
,
GetRange(int, int)
Measurement
Count
,
Capacity
Element addition
Add(T)
,
AddRange(
IEnumerable<T>
)
,
Insert(int, T)
,
InsertRange(int,
IEnumerable<T>
)
Element removal
Remove(T)
,
RemoveAll(
Predicate<T>
)
,
RemoveAt(int)
,
RemoveRange(int, int)
,
Clear()
Reorganization
Reverse()
,
Reverse(int, int)
,
Sort()
,
Sort(
Comparison<T>
)
,
Sort(
IComparer<T>
)
,
Sort(int, int,
IComparer<T>
)
Searching
BinarySearch(T)
,
BinarySearch(int, int, T,
IComparer<T>
)
,
BinarySearch(T,
IComparer<T>
)
Find(
Predicate<T>
)
,
FindAll(
Predicate<T>
)
,
FindIndex(
Predicate<T>
)
,
FindLast(
Predicate<T>
)
,
FindLastIndex(
Predicate<T>
)
,
IndexOf(T)
,
LastIndexOf(T)
Boolean queries
Contains(T)
,
Exists(
Predicate<T>
)
,
TrueForAll(
Predicate<T>
)
Conversions
ConvertAll<TOutput>(
Converter<T,TOutput>
)
,
CopyTo(T[])
,