Package xyz.cofe.iter

Class LimitIterable.LimitIter<A>

  • Type Parameters:
    A - тип элементов
    All Implemented Interfaces:
    Iterator<A>
    Enclosing class:
    LimitIterable<A>

    public static class LimitIterable.LimitIter<A>
    extends Object
    implements Iterator<A>
    Итератор с ограниченной по кол-ву выборкой
    • Field Detail

      • limit

        protected long limit
      • count

        protected volatile long count
    • Constructor Detail

      • LimitIter

        public LimitIter​(Iterator<A> iter,
                         long limit)
        Констркутор
        Parameters:
        iter - итератор
        limit - максимальное кол-во элементов
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<A>
      • next

        public A next()
        Specified by:
        next in interface Iterator<A>