Interface LineItemIterator
- All Superinterfaces:
AutoCloseable,Closeable,Iterator<LineItemHelper.LineItem>
A closeable iterator over
LineItemHelper.LineItem elements, backed either by a streaming DB
cursor or by an already materialized list. Must always be closed after use (try-with-resources or
withCloseable), regardless of the backing source.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanhasNext()next()static LineItemIteratorof(List<LineItemHelper.LineItem> items) Wraps an already materialized list of line items.Methods inherited from interface Iterator
forEachRemaining, remove
-
Method Details
-
of
Wraps an already materialized list of line items.close()is a no-op, so the same script works whether the helper streams from the database or iterates an in-memory document.- Parameters:
items- the line items to iterate over- Returns:
- an iterator over
items
-
hasNext
boolean hasNext()- Specified by:
hasNextin interfaceIterator<LineItemHelper.LineItem>
-
next
LineItemHelper.LineItem next()- Specified by:
nextin interfaceIterator<LineItemHelper.LineItem>
-
close
void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-