Class HeadIterator<T>

java.lang.Object
com.github.basking2.sdsai.itrex.iterators.HeadIterator<T>
Type Parameters:
T - The type.
All Implemented Interfaces:
Iterator<T>

public class HeadIterator<T> extends Object implements Iterator<T>
Return the first N elements of another iterator. This is used to implement the PagingIterator.
  • Constructor Details

    • HeadIterator

      public HeadIterator(int n, Iterator<T> iterator)
    • HeadIterator

      public HeadIterator(Iterator<T> iterator)
  • Method Details

    • hasNext

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

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