Class EmptyIterator<T>

java.lang.Object
com.fasterxml.aalto.util.EmptyIterator<T>
All Implemented Interfaces:
Iterator<T>

public final class EmptyIterator<T> extends Object implements Iterator<T>
Simple implementation of "null iterator", iterator that has nothing to iterate over.
  • Field Details

  • Constructor Details

    • EmptyIterator

      private EmptyIterator()
  • Method Details

    • getInstance

      public static <T> EmptyIterator<T> getInstance()
      Since the actual type has no effect (as this iterator never returns any value objects), we can just cast away here: bit unclean, but safe.
    • hasNext

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

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

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