mk.fsgrep.util
Class TargetFile

java.lang.Object
  extended by mk.fsgrep.util.TargetFile
All Implemented Interfaces:
java.lang.Comparable

public class TargetFile
extends java.lang.Object
implements java.lang.Comparable

A wrapper for the File object which caches the canonical name and the suffix, so these do not have to be determined multiple times.

Author:
Murali Krishnan

Nested Class Summary
 class TargetFile.LineReader
           
 
Constructor Summary
protected TargetFile()
           
  TargetFile(java.io.File pFile)
           
  TargetFile(java.io.File pFile, java.lang.String pSuffix)
           
  TargetFile(java.lang.String pFilename)
           
 
Method Summary
 void addFilterNumber(int number)
           
 void backup()
           
 int compareTo(java.lang.Object object)
           
 TargetFile.LineReader createLineReader()
           
 boolean equals(java.lang.Object object)
           
 java.io.File getFile()
           
 java.util.Collection<java.lang.Integer> getFilterNumbers()
           
protected  java.io.LineNumberReader getLineNumberReader()
           
 java.lang.String getName()
           
 java.lang.String getSuffix()
           
 void saveContent(java.util.Collection<FileLine> lines)
           
protected  void setLineNumberReader(java.io.LineNumberReader val)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TargetFile

public TargetFile(java.lang.String pFilename)

TargetFile

public TargetFile(java.io.File pFile)

TargetFile

public TargetFile(java.io.File pFile,
                  java.lang.String pSuffix)

TargetFile

protected TargetFile()
Method Detail

getFile

public java.io.File getFile()

getSuffix

public java.lang.String getSuffix()

getName

public java.lang.String getName()

getLineNumberReader

protected java.io.LineNumberReader getLineNumberReader()

getFilterNumbers

public java.util.Collection<java.lang.Integer> getFilterNumbers()

setLineNumberReader

protected void setLineNumberReader(java.io.LineNumberReader val)

toString

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

backup

public void backup()

createLineReader

public TargetFile.LineReader createLineReader()

saveContent

public void saveContent(java.util.Collection<FileLine> lines)

addFilterNumber

public void addFilterNumber(int number)

compareTo

public int compareTo(java.lang.Object object)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object


Copyright © 2009. All Rights Reserved.