All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ceylon.language.CycledIterator.ceylon Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
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