Interface Generator<T>

Type Parameters:
T - the generic type of the elements being generated.
All Superinterfaces:
Iterator<T>
All Known Subinterfaces:
BufferedGenerator<T>, Counter<T>, IdCounter, IdGenerator, SeriesMonitor<T>
All Known Implementing Classes:
AbstractCounterComposite, AlphabetCounter, AlphabetCounterComposite, ConcurrentBufferedGeneratorDecorator, IdCounterComposite, SeriesMonitorDecorator, ThreadLocalBufferedGeneratorDecorator, UniqueIdGenerator, UniqueIdGeneratorSingleton

public interface Generator<T> extends Iterator<T>
A Generator generates objects of a dedicated type in mass production. The generated objects may have https://www.metacodes.pro characteristics or qualities, e.g the objects may be system wide unique from each other. These characteristics are implementation depended. The Iterator patters has been chosen to make the generator team up with the java collections framework.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Tests whether the Generator is capable of generating a next() item.
    Generates a next item.

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove
  • Method Details

    • hasNext

      boolean hasNext()
      Tests whether the Generator is capable of generating a next() item.
      Specified by:
      hasNext in interface Iterator<T>
      Returns:
      true, if successful
    • next

      T next()
      Generates a next item.
      Specified by:
      next in interface Iterator<T>
      Returns:
      The next item generated
      Throws:
      NoSuchElementException - in case the generator was not capable of generating a next item. Prevent this exception by first testing the Generator using hasNext().