Class ArrayIterator<E>

java.lang.Object
io.github.mmm.base.collection.ArrayIterator<E>
Type Parameters:
E - type of the elements to iterate.
All Implemented Interfaces:
Enumeration<E>, Iterator<E>

public class ArrayIterator<E> extends Object implements Enumeration<E>, Iterator<E>
Implementation of both Iterator and Enumeration to iterate a given array. For performance the array is NOT copied so please note that modifications of the array given at construction will directly be reflected by this ArrayIterator.
Since:
1.0.0
  • Constructor Details

    • ArrayIterator

      public ArrayIterator(E[] array)
      The constructor.
      Parameters:
      array - is the array to iterate/enumerate.
    • ArrayIterator

      public ArrayIterator(E[] array, int start, int end)
      The constructor.
      Parameters:
      array - is the array to iterate/enumerate.
      start - is the index of the first item to iterate/enumerate in array.
      end - is the index of the last item to iterate/enumerate in array.
  • Method Details