Previously, spouts would implement Iterator interface and individual items’ data could be accessed by iterating the spout object and calling its methods.
With this change, each spout has getItems() method that returns an Iterator of Item objects for each item.
This is much cleaner design and having separate object for each source item allows for handling them independently even after iteration switched to a next step.
Previously, spouts would implement Iterator interface and individual items’ data could be accessed by iterating the spout object and calling its methods.
With this change, each spout has getItems() method that returns an Iterator of Item objects for each item.
This is much cleaner design and having separate object for each source item allows for handling them independently even after iteration switched to a next step.