Class ArrayNonNullIterator<T>

  • All Implemented Interfaces:
    java.util.Iterator<T>

    public class ArrayNonNullIterator<T>
    extends ArrayIterator<T>
    Iterator that only returns non-null elements of the array hasNext() return true when there is a non-null element, false otherwise next() returns the current element and advances the counter up to the next non-null element or beyond the limit of the array
    • Constructor Detail

      • ArrayNonNullIterator

        public ArrayNonNullIterator​(T[] elts)
      • ArrayNonNullIterator

        public ArrayNonNullIterator​(T[] elts,
                                    int start)
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
        Overrides:
        hasNext in class ArrayIterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
        Overrides:
        next in class ArrayIterator<T>