ListExtension<T> extension
extension for List<T>
.
- on
-
- List<
T>
- List<
Methods
-
allEquals(
T element) → bool -
Returns
true
if all elements are equals toelement
. -
asDoubles(
) → List< double> - Returns this instance as a List
-
asInts(
) → List< int> - Returns this instance as a List
-
binarySearchPoint(
T key, {int start = 0, int? end, Comparator< T> ? compare}) → int - A binary search that returns:
-
computeHashcode(
) → int -
Computes the
hashcode
of this List, usingListEquality
defaults. -
ensureMaximumSize(
int maximumSize, {bool removeFromEnd = false, int removeExtras = 0}) → int -
Ensures that this List.length is not bigger than
maximumSize
. -
equalsElements(
List< T> other) → bool -
Returns
true
if all the elements are equals toother
elements. -
getReversed(
int reversedIndex) → T -
Returns the elements at
reversedIndex
(index:[lastIndex - reversedIndex]
). -
getValueIfExists(
int index) → T? -
Returns the element at
index
. Returnsnull
if out of range. -
head(
int size) → List< T> -
Head of this List with
size
. -
headByRatio(
double sizeRatio, {int? minimumSize}) → List< T> -
Head of this List with
size
based the insizeRatio
oflength
. See lengthRatio. -
lengthRatio(
double ratio, {int? minimumSize}) → int -
Returns the
length
multiplied byratio
. -
randomSelection(
{int? length, double? lengthRatio, int? minimumSize, Random? random, int? seed}) → List< T> -
removeAll(
Iterable other) → void -
Remove from
this
List all the elements contained inother
. -
removeFromBegin(
int amount) → int -
Remove an
amount
of elements from the beginning. -
removeFromEnd(
int amount) → int -
Remove an
amount
of elements from the end. -
resampleByIndex<
R> (RangeSelectorFunction< T, RangeSelectionByIndex< selector, List<T> >R> merger(List<T> sel), {bool skipResampledIndexes = true}) → List<R> - Resample elements by index range (RangeSelectionByIndex).
-
resampleByValue<
R> (RangeSelectorFunction< T, RangeSelectionByValue< selector, List<T> >R> merger(List<T> sel), {bool skipResampledIndexes = true, Comparator<T> ? compare}) → List<R> - Resample elements by value range (RangeSelectionByValue).
-
retainAll(
Iterable other) → void -
Retain in
this
List all the elements contained inother
. -
searchInsertSortedIndex<
E, K> (T key, {int start = 0, int? end, Comparator< T> ? compare}) → int -
Returns the index to insert
key
and keep the List sorted. -
setAllWith(
T f(int index, T value)) → int -
Set all elements of this instance with values from
f
. -
setAllWithList(
List< T> list, [int offset = 0]) → int -
Set all elements of this instance with
list
, starting fromlist
offset
. -
setAllWithValue(
T value) → int -
Set all elements of this instance with
value
. -
shuffleCopy(
{Random? random, int? seed}) → List< T> -
sublistReversed(
int endReversed, [int? startReversed]) → List< T> -
Sames as sublist, but with reversed parameters indexes
endReversed
andstartReversed
. -
tail(
int size) → List< T> -
Tail of this List with
size
. -
tailByRatio(
double sizeRatio, {int? minimumSize}) → List< T> -
Tail of this List with
size
based the insizeRatio
oflength
. See lengthRatio. -
toDistinctList(
) → List< T> -
Converts to a list of distinct elements.
Same as
toSet().toList()
but in a optimized way for small sets. -
toStringElements(
) → List< String> -
Creates a new List<
String
>, mapping each element to aString
.