Class FastList<T>
- Namespace
- Stride.Core.Collections
- Assembly
- Stride.Core.dll
Similar to List<T>, with direct access to underlying array.
[DataSerializer(typeof(ListAllSerializer<,>), Mode = DataSerializerGenericMode.TypeAndGenericArguments)]
public class FastList<T> : IList<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
T
The type of elements in the list.
- Inheritance
-
FastList<T>
- Implements
-
IList<T>ICollection<T>IEnumerable<T>
- Derived
- Extension Methods
Constructors
FastList()
FastList(IEnumerable<T>)
Parameters
collection
IEnumerable<T>
FastList(int)
Parameters
capacity
int
Properties
Capacity
Property Value
Count
Gets the number of elements in the collection.
Property Value
- int
The number of elements in the collection.
this[int]
Gets or sets the element at the specified index.
Parameters
index
intThe zero-based index of the element to get or set.
Property Value
- T
The element at the specified index.
Exceptions
- Argument
Out OfRange Exception index
is not a valid index in the IList<T>.- Not
Supported Exception The property is set and the IList<T> is read-only.
Items
Gets the items.
Property Value
- T[]
Methods
Add(T)
Adds an item to the ICollection<T>.
Parameters
item
TThe object to add to the ICollection<T>.
Exceptions
- Not
Supported Exception The ICollection<T> is read-only.
AddRange(IEnumerable<T>)
Parameters
collection
IEnumerable<T>
AsReadOnly()
Returns
BinarySearch(int, int, T, IComparer<T>)
Parameters
Returns
BinarySearch(T)
Parameters
item
T
Returns
BinarySearch(T, IComparer<T>)
Parameters
item
Tcomparer
IComparer<T>
Returns
Clear()
Removes all items from the ICollection<T>.
Exceptions
- Not
Supported Exception The ICollection<T> is read-only.
Clear(bool)
Clears this list with a fast-clear option.
Parameters
fastClear
boolif set to
true
this method only resets the count elements but doesn't clear items referenced already stored in the list.
Contains(T)
Determines whether the ICollection<T> contains a specific value.
Parameters
item
TThe object to locate in the ICollection<T>.
Returns
- bool
true if
item
is found in the ICollection<T>; otherwise, false.
CopyTo(int, T[], int, int)
Parameters
CopyTo(T[])
Parameters
array
T[]
CopyTo(T[], int)
Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Parameters
array
T[]The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.
arrayIndex
intThe zero-based index in
array
at which copying begins.
Exceptions
- Argument
Null Exception array
is null.- Argument
Out OfRange Exception arrayIndex
is less than 0.- Argument
Exception The number of elements in the source ICollection<T> is greater than the available space from
arrayIndex
to the end of the destinationarray
.
EnsureCapacity(int)
Parameters
min
int
Exists(Predicate<T>)
Parameters
match
Predicate<T>
Returns
Find(Predicate<T>)
Parameters
match
Predicate<T>
Returns
- T
FindAll(Predicate<T>)
Parameters
match
Predicate<T>
Returns
- Fast
List <T>
FindIndex(int, int, Predicate<T>)
Parameters
Returns
FindIndex(int, Predicate<T>)
Parameters
Returns
FindIndex(Predicate<T>)
Parameters
match
Predicate<T>
Returns
FindLast(Predicate<T>)
Parameters
match
Predicate<T>
Returns
- T
FindLastIndex(int, int, Predicate<T>)
Parameters
Returns
FindLastIndex(int, Predicate<T>)
Parameters
Returns
FindLastIndex(Predicate<T>)
Parameters
match
Predicate<T>
Returns
ForEach(Action<T>)
Parameters
action
Action<T>
GetEnumerator()
Returns
GetRange(int, int)
Parameters
Returns
- Fast
List <T>
IncreaseCapacity(int)
Parameters
index
int
IndexOf(T)
Determines the index of a specific item in the IList<T>.
Parameters
item
TThe object to locate in the IList<T>.
Returns
- int
The index of
item
if found in the list; otherwise, -1.
IndexOf(T, int)
Parameters
item
Tindex
int
Returns
IndexOf(T, int, int)
Parameters
Returns
Insert(int, T)
Inserts an item to the IList<T> at the specified index.
Parameters
index
intThe zero-based index at which
item
should be inserted.item
TThe object to insert into the IList<T>.
Exceptions
- Argument
Out OfRange Exception index
is not a valid index in the IList<T>.- Not
Supported Exception The IList<T> is read-only.
InsertRange(int, IEnumerable<T>)
Parameters
index
intcollection
IEnumerable<T>
LastIndexOf(T)
Parameters
item
T
Returns
LastIndexOf(T, int)
Parameters
item
Tindex
int
Returns
LastIndexOf(T, int, int)
Parameters
Returns
Remove(T)
Removes the first occurrence of a specific object from the ICollection<T>.
Parameters
item
TThe object to remove from the ICollection<T>.
Returns
- bool
true if
item
was successfully removed from the ICollection<T>; otherwise, false. This method also returns false ifitem
is not found in the original ICollection<T>.
Exceptions
- Not
Supported Exception The ICollection<T> is read-only.
RemoveAll(Predicate<T>)
Parameters
match
Predicate<T>
Returns
RemoveAt(int)
Removes the IList<T> item at the specified index.
Parameters
index
intThe zero-based index of the item to remove.
Exceptions
- Argument
Out OfRange Exception index
is not a valid index in the IList<T>.- Not
Supported Exception The IList<T> is read-only.
RemoveRange(int, int)
Parameters
Resize(int, bool)
Parameters
Reverse()
Reverse(int, int)
Parameters
Sort()
Sort(IComparer<T>)
Parameters
comparer
IComparer<T>
Sort(int, int, IComparer<T>)
Parameters
ToArray()
Returns
- T[]
TrimExcess()
TrueForAll(Predicate<T>)
Parameters
match
Predicate<T>