Campbell Ritchie wrote:The other half thinks that Scanner is intended to tokenise its input, giving you anint then a double then a word, so what would its method look like?
Well, by default
Scanner is an
Iterator to its tokens, which suggests to me that it could possibly look something like this:
but since I'm new to all this stuff there may well be better ways - or I could be totally wrong.
Edit - Looking at the docs, it seems that it might be better to use
StreamSupport.stream(Supplier, int, boolean), since
Iterable's default method returns an early-binding
Spliterator; but not sure how to do that yet, or whether it makes any difference in this case.
Winston