-
- All Implemented Interfaces:
public final class IterableExtensionKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> List<T>takePercentage(List<T> $self, Double percentage)Takes the first percentage * size elements of the list. final static <P extends Position<P>> List<P>toPositions(Array<out Number> $self, Environment<?, P> environment)Converts an array of numbers representing positions to an actual list of positions. final static <T extends Any> Sequence<Pair<T, T>>cartesianProduct(Sequence<T> $self, Sequence<T> other)Performs the cartesian product of two sequences. -
-
Method Detail
-
takePercentage
final static <T extends Any> List<T> takePercentage(List<T> $self, Double percentage)
Takes the first percentage * size elements of the list.
-
toPositions
final static <P extends Position<P>> List<P> toPositions(Array<out Number> $self, Environment<?, P> environment)
Converts an array of numbers representing positions to an actual list of positions. E.g. the array 2,3,4,5 in a bidimensional environment would be transformed into a list containing positions (2,3) and (4,5).
-
-
-
-