Module openj9.dtfj

Class SingletonIterator

java.lang.Object
com.ibm.j9ddr.corereaders.tdump.zebedee.util.SingletonIterator
All Implemented Interfaces:
Iterator

public class SingletonIterator extends Object implements Iterator
This class provides an iterator with a single element.
  • Constructor Details

    • SingletonIterator

      public SingletonIterator(Object element)
      Create a new SingletonIterator for the given element.
  • Method Details

    • hasNext

      public boolean hasNext()
      Description copied from interface: java.util.Iterator
      Returns true if the iteration has more elements. (In other words, returns true if Iterator.next() would return an element rather than throwing an exception.)
      Specified by:
      hasNext in interface Iterator
      Returns:
      true if the iteration has more elements
    • next

      public Object next()
      Description copied from interface: java.util.Iterator
      Returns the next element in the iteration.
      Specified by:
      next in interface Iterator
      Returns:
      the next element in the iteration