public class TextLineIterable extends Object implements Iterable<String>
Iterable
that can provide access to lines of a text file
referenced by a File
or URL
. It is safe to re-use this
Iterable
instance; a new BufferedReader
will be created when
iterator()
is called. Any IOException
s are wrapped as
RuntimeException
s.Modifier and Type | Class and Description |
---|---|
static class |
TextLineIterable.GZIPFileProvider
A
TextLineIterable.Provider for gzipped text files |
static interface |
TextLineIterable.Provider
Interface describing things that can provide input for a
TextLineIterable |
Constructor and Description |
---|
TextLineIterable(File f)
Construct with the given file
|
TextLineIterable(File f,
String charset)
Construct with the given file and charset
|
TextLineIterable(TextLineIterable.Provider source)
Construct with the given provider
|
TextLineIterable(URL f)
Construct with the given url
|
TextLineIterable(URL f,
String charset)
Construct with the given url and charset
|
Modifier and Type | Method and Description |
---|---|
Iterator<String> |
iterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public TextLineIterable(TextLineIterable.Provider source)
source
- the providerpublic TextLineIterable(File f)
f
- the filepublic TextLineIterable(File f, String charset)
f
- the filecharset
- the character setpublic TextLineIterable(URL f, String charset)
f
- the urlcharset
- the character setpublic TextLineIterable(URL f)
f
- the url