mk.fsgrep.util
Class RawLineReader

java.lang.Object
  extended by mk.fsgrep.util.RawLineReader

public class RawLineReader
extends java.lang.Object

A utility that fully reads a file and provides access to the contents as a List of lines. It is meant to replace LineNumberReader and (its parent) BufferedReader because those consume the EOL characters when returning lines.

Author:
Murali Krishnan

Constructor Summary
protected RawLineReader()
          For testing only.
  RawLineReader(java.io.File pFile)
           
  RawLineReader(java.lang.String pFileName)
           
 
Method Summary
protected  java.io.File getFile()
           
protected  java.lang.String getFileName()
           
protected  java.util.LinkedList<FileLine> getLines()
           
 int getSize()
           
 boolean hasMore()
           
protected  void initialize()
           
protected  void initialize(java.io.Reader reader)
           
protected  void initialize(java.lang.String content)
           
static void main(java.lang.String[] args)
           
 FileLine nextLine()
           
protected  void saveTo(java.lang.String pString)
           
 void setSize(int val)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RawLineReader

public RawLineReader(java.lang.String pFileName)

RawLineReader

public RawLineReader(java.io.File pFile)

RawLineReader

protected RawLineReader()
For testing only.

Method Detail

getFile

protected java.io.File getFile()

getSize

public int getSize()

getLines

protected java.util.LinkedList<FileLine> getLines()

setSize

public void setSize(int val)

initialize

protected void initialize()

initialize

protected void initialize(java.io.Reader reader)
                   throws java.io.IOException
Throws:
java.io.IOException

initialize

protected void initialize(java.lang.String content)

getFileName

protected java.lang.String getFileName()

saveTo

protected void saveTo(java.lang.String pString)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hasMore

public boolean hasMore()

nextLine

public FileLine nextLine()

main

public static void main(java.lang.String[] args)


Copyright © 2009. All Rights Reserved.