ListExtensions<T> extension
Provides extended methods for List in T
.
T
のList用の拡張メソッドを提供します。
Properties
-
isJsonEncodable
→ bool
-
If this object is Json encodable,
true
is returned.
no setter
Methods
-
clone({bool growable = false})
→ List<T>
-
Clone another listing from an existing listing.
-
containsIndex(int index)
→ bool
-
Returns
true
if index
is within the range of elements in List.
-
get<E>(int index, E defaultValue)
→ E
-
Get the
index
th element.
-
getRandom([int? seed])
→ T?
-
Get a random element from List.
-
insertFirst(T element)
→ List<T>
-
Insert
element
at the beginning of List.
-
insertLast(T element)
→ List<T>
-
Insert
element
at the end of List.
-
insertWhere(T element, bool test(T? prev, T? current, T? next))
→ List<T>
-
Inserts
element
before the first element in List for which the return value of test
is true
.
-
shuffleTo([Random? random])
→ List<T>
-
Randomly sort this list.
-
sortTo([int compare(T a, T b)?])
→ List<T>
-
Sorts this list according to the order specified by the
compare
function.