Class IndexBasedIterator<T>

java.lang.Object
org.aksw.commons.collections.cache.IndexBasedIterator<T>
All Implemented Interfaces:
Iterator<T>

public class IndexBasedIterator<T> extends Object implements Iterator<T>
  • Field Details

    • list

      protected List<T> list
    • offset

      protected int offset
  • Constructor Details

    • IndexBasedIterator

      public IndexBasedIterator(List<T> list)
    • IndexBasedIterator

      public IndexBasedIterator(List<T> list, int offset)
  • Method Details

    • hasNext

      public boolean hasNext()
      Simply try to access an element by index. This way, a lazy loading list can block the call to .get() until it knows whether there is sufficient data.
      Specified by:
      hasNext in interface Iterator<T>
    • next

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

      public int getOffset()
    • toString

      public String toString()
      Overrides:
      toString in class Object