ceylon.language.CycledIterator.ceylon Maven / Gradle / Ivy
class CycledIterator
({Element*} iterable, Integer times)
satisfies Iterator {
variable Iterator iter = emptyIterator;
variable Integer count=0;
shared actual Element|Finished next() {
if (!is Finished next = iter.next()) {
return next;
}
else {
if (count "``iterable``.repeat(``times``).iterator()";
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy