utilMDE
Class TextFile

Object
  extended by TextFile
All Implemented Interfaces:
Iterable<String>

Deprecated.

@Deprecated
public class TextFile
extends Object
implements Iterable<String>

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.

See Also:
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

TextFile

public TextFile(String filename)
         throws IOException
Deprecated. 
Throws:
IOException

TextFile

public TextFile(String filename,
                String charsetName)
         throws IOException
Deprecated. 
Throws:
IOException

TextFile

public TextFile(File f)
         throws IOException
Deprecated. 
Throws:
IOException

TextFile

public TextFile(File f,
                String charsetName)
         throws IOException
Deprecated. 
Throws:
IOException

TextFile

public TextFile(InputStream is)
Deprecated. 

TextFile

public TextFile(InputStream is,
                String charsetName)
Deprecated. 
Method Detail

iterator

public Iterator<String> iterator()
Deprecated. 
Specified by:
iterator in interface Iterable<String>