T
- The type of the productspublic interface Producer<T>
Object
each time the
produce()
method is invoked. This behavior is similar to the
Iterator
, but is represented by one single
produce()
method as opposed to Iterator
's
two methods Iterator.hasNext()
and
Iterator.next()
. This simplifies the implementation of
certain complex iterations.DirectoryIterator
,
ProducerIterator
Modifier and Type | Method and Description |
---|---|
T |
produce()
Produce the next object.
|
T produce()
null
to indicate that no more objects can be producedCopyright © 2001–2016. All rights reserved.