|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectTextFile
@Deprecated public class TextFile
TextFile implements Iterable<String> allowing text files to be iterated line by line with the for/in loop. You might use it with code like this:
TextFile textfile = new TextFile(filename, "UTF-8");
int lineNumber = 0;
for (String line : textfile)
System.out.printf("%6d: %s%n", ++lineNumber, line);
The iterator makes no attempt to detect
concurrent modifications to the underlying file. If you want to do that
yourself, take a look at java.nio.channels.FileLock.
MultiReader| Constructor Summary | |
|---|---|
TextFile(File f)
Deprecated. |
|
TextFile(File f,
String charsetName)
Deprecated. |
|
TextFile(InputStream is)
Deprecated. |
|
TextFile(InputStream is,
String charsetName)
Deprecated. |
|
TextFile(String filename)
Deprecated. |
|
TextFile(String filename,
String charsetName)
Deprecated. |
|
| Method Summary | |
|---|---|
Iterator<String> |
iterator()
Deprecated. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextFile(String filename)
throws IOException
IOException
public TextFile(String filename,
String charsetName)
throws IOException
IOException
public TextFile(File f)
throws IOException
IOException
public TextFile(File f,
String charsetName)
throws IOException
IOExceptionpublic TextFile(InputStream is)
public TextFile(InputStream is,
String charsetName)
| Method Detail |
|---|
public Iterator<String> iterator()
iterator in interface Iterable<String>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||