Scanner was leaking through the abstraction.
Removing the scanner from the Abstract Class and adding a hasNextLine instead.
Adding FilePointerIterable: better name pending.
Refactoring where the abstraction leaks.
- Changed the hasNextLine method to hasLineAt(int). This way the iterable can be more explicit to what it wants, rather than depending on the underlying stream to tell it whether or not it has more lines left. Which was awkward to begin with.
- Changed the hasNextLine method to hasLineAt(int). This way the iterable can be more explicit to what it wants.
- Adding tests to make sure we can use the iterator more than one for the new implementation.
- Adding tests to make sure random access works on a file for the new implementation.
- Adding a really crappy implementation for hasLineAt which basically tries to call get at the index and catches the exception. This is backwards and needs to be fixed. But it works.