()
| 169 | } |
| 170 | |
| 171 | public T next() { |
| 172 | if (cell == null) { |
| 173 | path = nextPath; |
| 174 | nextPath = nextPath(); |
| 175 | cell = path.value(); |
| 176 | } |
| 177 | prevPrevCell = prevCell; |
| 178 | prevCell = cell; |
| 179 | cell = cell.next; |
| 180 | canRemove = true; |
| 181 | return prevCell.value; |
| 182 | } |
| 183 | |
| 184 | private PersistentSet.Path nextPath() { |
| 185 | return reversed ? path.predecessor() : path.successor(); |