RepeatingListSequence

class RepeatingListSequence<T>(values: List<T>, offset: Int) : Sequence<T> (source)

!! No backward compatibility guarantees !! Reuse at your own risk

We saw in benchmarks that using a specialised version which does not need to pass getElementAt (e.g. to IntRepeatingSequence) is significantly faster, hence the specialised version for List and Array. On the other hand, it was not worth to introduce a specialised Iterator, I guess JIT inlines getElementAt so there's no difference

Since

2.0.0

Constructors

Link copied to clipboard
constructor(values: List<T>, offset: Int)

Functions

Link copied to clipboard

Concatenates all given OrderedArgsGenerator resulting in an OrderedArgsGenerator which yields the values of the first OrderedArgsGenerator, then the second generator ... up to the values of the last generator and then starting over.

Concatenates all given SemiOrderedArgsGenerator resulting in an SemiOrderedArgsGenerator which yields the values of the first SemiOrderedArgsGenerator, then the second generator ... up to the values of the last generator and then starting over.

Link copied to clipboard
open operator override fun iterator(): Iterator<T>
Link copied to clipboard
fun <T> Sequence<T>.takeRandomly(amount: Int): Sequence<T>

Takes the given amount of elements from this Sequence (likewise Sequence.take) but in a random way based on the configured VariistConfig.seed.