public class TextResourceFile
extends java.lang.Object
implements java.lang.Iterable<java.lang.String>
String
s accessed sequentially through the class's Iterator
.Constructor and Description |
---|
TextResourceFile(java.lang.String filename)
Constructs a
TextResourceFile object that will take lines
sequentially from the text file with the given name relative to the
classpath. |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<java.lang.String> |
iterator()
This implementation does not support
Iterator.remove() . |
public TextResourceFile(java.lang.String filename)
TextResourceFile
object that will take lines
sequentially from the text file with the given name relative to the
classpath. If this is going in a .jar
file and you are using
Windows, use '/' for the name separator character, not
File.separatorChar
, as '\' doesn't work in .jar
files.filename
- the name of the resource filejava.util.MissingResourceException
- if the resource file is not found or cannot be readpublic java.util.Iterator<java.lang.String> iterator()
Iterator.remove()
.iterator
in interface java.lang.Iterable<java.lang.String>
Iterator
that returns the lines of the text file
sequentiallyjava.lang.IllegalStateException
- if the iterator is accessed more than once