Functions for the builder of a flat list, Builder.
The builder is mutable. The functions that change it return the same builder, so that the calls chain with the pipe operator. FlatList.builder creates a builder, and FlatList.ofBuilder returns its contents as a flat list.
| Function or value | Description | ||||
|
|||||
|
|
||||
Full Usage:
FlatListBuilder.blit source sourceIndex target targetIndex count
Parameters:
Builder<'T>
-
The builder.
sourceIndex : int
-
The index of the first element to copy.
target : 'T array
-
The array to copy to.
targetIndex : int
-
The index in the target array of the first copied element.
count : int
-
The number of elements to copy.
|
O(count). The function wraps
Builder.CopyTo.
It names the parameters target, targetIndex and count where
the BCL names them
|
||||
Full Usage:
FlatListBuilder.capacity builder
Parameters:
Builder<'T>
-
The builder.
Returns: int
The capacity.
|
|||||
|
|||||
Full Usage:
FlatListBuilder.contains value builder
Parameters:
'T
-
The value to find.
builder : Builder<'T>
-
The builder.
Returns: bool
when an element equals the value.
|
|
||||
|
|||||
Full Usage:
FlatListBuilder.indexOf value builder
Parameters:
'T
-
The value to find.
builder : Builder<'T>
-
The builder.
Returns: int
The index, or -1.
|
|||||
Full Usage:
FlatListBuilder.indexOfRange startIndex count value builder
Parameters:
int
-
The index of the first element of the range.
count : int
-
The number of elements of the range.
value : 'T
-
The value to find.
builder : Builder<'T>
-
The builder.
Returns: int
The index in the builder of the first equal element of the range, or -1.
|
O(count). The function wraps Builder.IndexOf. The function throws what the BCL member throws. The member of .NET 8 and .NET 10 rejects also an empty range at a start index that equals the count of the builder, and it accepts for an empty builder only the start index 0 with the count 0, which gives -1.
|
||||
Full Usage:
FlatListBuilder.indexOfRangeWith comparer startIndex count value builder
Parameters:
IEqualityComparer<'T>
-
The equality comparer. stands for
EqualityComparer.
startIndex : int
-
The index of the first element of the range.
count : int
-
The number of elements of the range.
value : 'T
-
The value to find.
builder : Builder<'T>
-
The builder.
Returns: int
The index in the builder of the first equal element of the range, or -1.
|
O(count). The function wraps Builder.IndexOf. The function throws what the BCL member throws. The member of .NET 8 and .NET 10 rejects also an empty range at a start index that equals the count of the builder, and it accepts for an empty builder only the start index 0 with the count 0, which gives -1.
|
||||
|
|
||||
|
O(n + m) for m values. The function wraps Builder.InsertRange. The index is checked before the values, as the BCL member does.
|
||||
Full Usage:
FlatListBuilder.item index builder
Parameters:
int
-
The index of the element.
builder : Builder<'T>
-
The builder.
Returns: 'T
The element.
|
|
||||
Full Usage:
FlatListBuilder.lastIndexOf value builder
Parameters:
'T
-
The value to find.
builder : Builder<'T>
-
The builder.
Returns: int
The index, or -1.
|
|||||
Full Usage:
FlatListBuilder.lastIndexOfRange startIndex count value builder
Parameters:
int
-
The index of the last element of the range, where the search starts.
count : int
-
The number of elements of the range, counted backward from the start index.
value : 'T
-
The value to find.
builder : Builder<'T>
-
The builder.
Returns: int
The index in the builder of the last equal element of the range, or -1.
|
Returns the index of the last element equal to a value in a range that is searched backward, in EqualityComparer.
O(count). The range holds the elements from startIndex down to
The function throws what the BCL member throws. The member of .NET 8 and .NET 10 rejects also an empty range at a start index that equals the count of the builder, and it accepts for an empty builder only the start index 0 with the count 0, which gives -1.
|
||||
Full Usage:
FlatListBuilder.lastIndexOfRangeWith comparer startIndex count value builder
Parameters:
IEqualityComparer<'T>
-
The equality comparer. stands for
EqualityComparer.
startIndex : int
-
The index of the last element of the range, where the search starts.
count : int
-
The number of elements of the range, counted backward from the start index.
value : 'T
-
The value to find.
builder : Builder<'T>
-
The builder.
Returns: int
The index in the builder of the last equal element of the range, or -1.
|
O(count). The range holds the elements from startIndex down to
The function throws what the BCL member throws. The member of .NET 8 and .NET 10 rejects also an empty range at a start index that equals the count of the builder, and it accepts for an empty builder only the start index 0 with the count 0, which gives -1.
|
||||
Full Usage:
FlatListBuilder.length builder
Parameters:
Builder<'T>
-
The builder.
Returns: int
The number of elements.
|
|||||
Full Usage:
FlatListBuilder.remove value builder
Parameters:
'T
-
The value to remove.
builder : Builder<'T>
-
The builder.
Returns: bool
when an element was removed.
|
|
||||
|
O(n). The function wraps Builder.RemoveAll.
|
||||
|
|
||||
|
O(n * m) for m values. Each value removes the first remaining element that equals it; a value that equals no remaining element removes nothing. The function wraps Builder.RemoveRange.
|
||||
|
O(n). The function wraps
Builder.RemoveRange. It
names the parameter count where the BCL names it
|
||||
Full Usage:
FlatListBuilder.removeManyWith comparer items builder
Parameters:
IEqualityComparer<'T>
-
The equality comparer. stands for
EqualityComparer.
items : 'T seq
-
The values to remove.
builder : Builder<'T>
-
The builder.
Returns: Builder<'T>
The same builder.
|
O(n * m) for m values. Each value removes the first remaining element that equals it; a value that equals no remaining element removes nothing. The function wraps Builder.RemoveRange.
|
||||
Full Usage:
FlatListBuilder.removeWith comparer value builder
Parameters:
IEqualityComparer<'T>
-
The equality comparer. stands for
EqualityComparer.
value : 'T
-
The value to remove.
builder : Builder<'T>
-
The builder.
Returns: bool
when an element was removed.
|
O(n). The function wraps Builder.Remove.
|
||||
|
O(n). The function wraps Builder.Replace. The builder stays as it is when no element equals the old value: the BCL member does not throw. The function FlatList.replace of the flat list throws ArgumentException in that case.
|
||||
Full Usage:
FlatListBuilder.replaceWith comparer oldValue newValue builder
Parameters:
IEqualityComparer<'T>
-
The equality comparer. stands for
EqualityComparer.
oldValue : 'T
-
The value to replace.
newValue : 'T
-
The new value.
builder : Builder<'T>
-
The builder.
Returns: Builder<'T>
The same builder.
|
O(n). The function wraps Builder.Replace. The builder stays as it is when no element equals the old value: the BCL member does not throw. The function FlatList.replaceWith of the flat list throws ArgumentException in that case.
|
||||
|
|||||
|
|
||||
|
|||||
|
O(count log count). This is not a stable sort. The elements outside the range keep their places. The function wraps Builder.Sort.
|
||||
Full Usage:
FlatListBuilder.sortRangeWith comparison index count builder
Parameters:
'T -> 'T -> int
-
The function that compares two elements.
index : int
-
The index of the first element of the range.
count : int
-
The number of elements of the range.
builder : Builder<'T>
-
The builder.
Returns: Builder<'T>
The same builder.
|
O(count log count). This is not a stable sort. The elements outside the range keep their places. The function wraps Builder.Sort.
|
||||
Full Usage:
FlatListBuilder.sortRangeWithComparer comparer index count builder
Parameters:
IComparer<'T>
-
The comparer. stands for Comparer.
index : int
-
The index of the first element of the range.
count : int
-
The number of elements of the range.
builder : Builder<'T>
-
The builder.
Returns: Builder<'T>
The same builder.
|
O(count log count). This is not a stable sort. The elements outside the range keep their places. The function wraps Builder.Sort.
|
||||
|
|||||
|
|||||
Full Usage:
FlatListBuilder.toArray builder
Parameters:
Builder<'T>
-
The builder.
Returns: 'T array
A copy of the elements.
|
|||||
|
|