Note that this one iterator instance is shared by any calls to iterate the rows of this table. This is very efficient, but not thread-safe. If you want to iterate in a multi-threaded manner, don't use the iterator. @webref table:method @brief Gets multiple rows from a table @see Table#getRow(int) @
()
| 2670 | * @see Table#matchRows(String, int) |
| 2671 | */ |
| 2672 | public Iterable<TableRow> rows() { |
| 2673 | return new Iterable<TableRow>() { |
| 2674 | public Iterator<TableRow> iterator() { |
| 2675 | if (rowIterator == null) { |
| 2676 | rowIterator = new RowIterator(Table.this); |
| 2677 | } else { |
| 2678 | rowIterator.reset(); |
| 2679 | } |
| 2680 | return rowIterator; |
| 2681 | } |
| 2682 | }; |
| 2683 | } |
| 2684 | |
| 2685 | /** |
| 2686 | * @nowebref |
no outgoing calls
no test coverage detected