DHUCollectionsExtensions<E> extension
Utility extensions for non-nullable iterables.
- on
-
- Iterable<
E>
- Iterable<
Properties
- halfLength → int
-
Available on Iterable<
Returns half the length (floored).E> , provided by the DHUCollectionsExtensions extensionno setter
Methods
-
associate<
K, V> (K keySelector(E), [V valueSelector(E)?]) → Map< K, V> -
Available on Iterable<
Converts the iterable to a map usingE> , provided by the DHUCollectionsExtensions extensionkeySelectorand optionalvalueSelector. -
chunks(
int size) → List< List< E> > -
Available on Iterable<
Splits the iterable into chunks of sizeE> , provided by the DHUCollectionsExtensions extensionsize. -
concatWithMultipleList(
List< Iterable< iterables) → List<E> >E> -
Available on Iterable<
Returns a list that concatenates this iterable withE> , provided by the DHUCollectionsExtensions extensioniterables. -
concatWithSingleList(
Iterable< E> iterable) → List<E> -
Available on Iterable<
Returns a list that concatenates this iterable withE> , provided by the DHUCollectionsExtensions extensioniterable. -
containsAll(
Iterable< E> collection) → bool -
Available on Iterable<
Checks if all elements in the specifiedE> , provided by the DHUCollectionsExtensions extensioncollectionare contained in this collection. -
distinctBy<
R> (R keySelector(E), {bool equals(R a, R b)?, int hashCode(R key)?, bool isValidKey(R key)?}) → List< E> -
Available on Iterable<
Returns a new list containing the first occurrence of each distinct element as determined by the key returned fromE> , provided by the DHUCollectionsExtensions extensionkeySelector. -
drop(
int n) → List< E> -
Available on Iterable<
Returns a list containing all elements except the firstE> , provided by the DHUCollectionsExtensions extensionnelements. -
filter(
Predicate< E> test) → List<E> -
Available on Iterable<
Returns a list containing elements that satisfyE> , provided by the DHUCollectionsExtensions extensiontest. -
filterNot(
Predicate< E> test) → List<E> -
Available on Iterable<
Returns a list containing elements that do not satisfyE> , provided by the DHUCollectionsExtensions extensiontest. -
find(
Predicate< E> predicate) → E? -
Available on Iterable<
Returns the first element matchingE> , provided by the DHUCollectionsExtensions extensionpredicate, ornullif element was not found. -
firstHalf(
) → List< E> -
Available on Iterable<
Returns the first half of the iterable.E> , provided by the DHUCollectionsExtensions extension -
getRandom(
[int? seed]) → E -
Available on Iterable<
Returns a random element.E> , provided by the DHUCollectionsExtensions extension -
intersperse(
E element) → Iterable< E> -
Available on Iterable<
InsertsE> , provided by the DHUCollectionsExtensions extensionelementbetween every element in the iterable. -
mapConcurrent<
R> (Future< R> action(E item), {int parallelism = 1}) → Future<List< R> > -
Available on Iterable<
ExecutesE> , provided by the DHUCollectionsExtensions extensionactionon each element with at mostparallelismconcurrent tasks. -
orEmpty(
) → Iterable< E> -
Available on Iterable<
Returns this iterable (as is) if it is non-null; otherwise, returns an empty iterable.E> , provided by the DHUCollectionsExtensions extension -
pairwise(
) → List< (E, E)> -
Available on Iterable<
Returns consecutive pairs from the iterable.E> , provided by the DHUCollectionsExtensions extension -
partition(
bool predicate(E)) → (List< E> , List<E> ) -
Available on Iterable<
Splits the iterable into two lists based on theE> , provided by the DHUCollectionsExtensions extensionpredicate. -
secondHalf(
) → List< E> -
Available on Iterable<
Returns the second half of the iterable.E> , provided by the DHUCollectionsExtensions extension -
subtract(
Iterable< E> other) → Set<E> -
Available on Iterable<
Returns a set of elements contained in this collection but not inE> , provided by the DHUCollectionsExtensions extensionother. The returned set preserves the element iteration order of the original collection. -
swap(
int i, int j) → List< E> -
Available on Iterable<
Returns a list with elements atE> , provided by the DHUCollectionsExtensions extensioniandjswapped. -
takeOnly(
int n) → List< E> -
Available on Iterable<
Returns a list containing the firstE> , provided by the DHUCollectionsExtensions extensionnelements. -
toListConverted<
R> () → List< R> -
Available on Iterable<
Converts this iterable to a list of typeE> , provided by the DHUCollectionsExtensions extensionRusing convert_object logic. -
toSetConverted<
R> () → Set< R> -
Available on Iterable<
Converts this iterable to a set of typeE> , provided by the DHUCollectionsExtensions extensionRusing convert_object logic. -
windowed(
int size, {int step = 1, bool partials = false}) → List< List< E> > -
Available on Iterable<
Returns a sliding window ofE> , provided by the DHUCollectionsExtensions extensionsizeover the iterable.