/** Wraps a file given by a {@link File} object into an iterator. * * @param file a file. */ public static BooleanIterator asBooleanIterator(final File file) throws IOException { return new BooleanReaderWrapper(new BufferedReader(new FileReader(file))); } /** Wraps a file given by a pathname into an iterator.
@Override public boolean nextBoolean() { if (! hasNext()) throw new NoSuchElementException(); toAdvance = true; return next; } }
/** Wraps the given buffered reader into an iterator. * * @param reader a buffered reader. */ public static BooleanIterator asBooleanIterator(final BufferedReader reader) { return new BooleanReaderWrapper(reader); } /** Wraps a file given by a {@link File} object into an iterator.