mk.fsgrep
Class Fsgrep

java.lang.Object
  extended by mk.fsgrep.Fsgrep
All Implemented Interfaces:
java.lang.Runnable

public class Fsgrep
extends java.lang.Object
implements java.lang.Runnable

The primary application class.

Author:
Murali Krishnan

Field Summary
static mk.fsgrep.Action ACTION_LISTFILES
           
static mk.fsgrep.Action ACTION_REPLACE
           
static mk.fsgrep.Action ACTION_RESCAN
           
static mk.fsgrep.Action ACTION_SEARCH
           
static mk.fsgrep.Action ACTION_UNDEFINED
           
static boolean DEBUG
           
protected static SearchFactory factory
           
static java.lang.String LICENSE
           
static ManifestProperties MANIFEST_PROPS
           
protected static java.util.regex.Pattern RE_STRIP_EOL
           
static java.lang.String README
           
static java.lang.String USAGE
           
static java.lang.String VERSION
           
static java.lang.String VERSION_EXTRA
           
 
Constructor Summary
protected Fsgrep()
          Only for testing.
  Fsgrep(Args pArgs)
           
 
Method Summary
 void finishFile(FileSearch fileSearch)
           
 mk.fsgrep.Action getAction()
           
 boolean getAlwaysRescan()
           
 Args getArgs()
           
protected  Finder getBackupFinder()
           
 Finder getFinder()
           
 ResultCounter getFinishedCounter()
           
 OutputDestination getLiveOutput()
           
 ResultCounter getMatchCounter()
           
protected  int getMatchFlag()
           
 java.lang.String getPattern()
           
protected  ProgressBar getProgress()
           
 java.util.regex.Pattern getRE()
           
 ResultCounter getRemainingCounter()
           
 java.lang.String getReplacement()
           
 OutputDestination getReportOutput()
           
protected  java.util.List<java.lang.String> getResultFilelist()
           
 java.util.List<MatchResult> getResultList()
           
 OutputDestination getResultOutput()
           
 OutputDestination getStatusOutput()
           
 void initialize(OutputDestination pReport, OutputDestination pResult, OutputDestination pLive, OutputDestination pStatus, ProgressBar pBar)
           
 boolean isAborted()
           
 boolean isActionSearch()
           
protected  void listFiles()
           
static void main(java.lang.String[] cmdLineArgs)
           
protected  void prepare()
           
protected  void printMemory()
           
protected  void replace()
           
protected  void replacePattern()
           
 void restoreFinder()
           
 void run()
           
static void run(Args args)
           
protected  void search()
           
protected  void searchForPattern()
           
 void setAborted(boolean val)
           
 void setAction(mk.fsgrep.Action val)
           
protected  void setBackupFinder(Finder val)
           
 void setFinder(Finder val)
           
 void setFinishedCounter(ResultCounter val)
           
 void setLiveOutput(OutputDestination val)
           
 void setMatchCounter(ResultCounter val)
           
 void setPattern(java.lang.String pPattern)
           
protected  void setRE(java.util.regex.Pattern val)
           
 void setRemainingCounter(ResultCounter val)
           
 void setReplacement(java.lang.String val)
           
protected  void showFilelistResult()
           
protected  void showMatchResult()
           
protected  void showResult(Timer timer)
           
static java.lang.String stripEol(java.lang.String string)
           
 java.lang.String toString()
           
protected  int totalLinesSearched()
           
protected  void totalLinesSearched(int val)
           
 void useTransientFinder(Finder pFinder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MANIFEST_PROPS

public static final ManifestProperties MANIFEST_PROPS

USAGE

public static final java.lang.String USAGE

README

public static final java.lang.String README

LICENSE

public static final java.lang.String LICENSE

VERSION

public static final java.lang.String VERSION

VERSION_EXTRA

public static final java.lang.String VERSION_EXTRA

ACTION_UNDEFINED

public static final mk.fsgrep.Action ACTION_UNDEFINED

ACTION_SEARCH

public static final mk.fsgrep.Action ACTION_SEARCH

ACTION_REPLACE

public static final mk.fsgrep.Action ACTION_REPLACE

ACTION_LISTFILES

public static final mk.fsgrep.Action ACTION_LISTFILES

ACTION_RESCAN

public static final mk.fsgrep.Action ACTION_RESCAN

factory

protected static final SearchFactory factory

DEBUG

public static final boolean DEBUG

RE_STRIP_EOL

protected static final java.util.regex.Pattern RE_STRIP_EOL
Constructor Detail

Fsgrep

public Fsgrep(Args pArgs)

Fsgrep

protected Fsgrep()
Only for testing.

Method Detail

run

public static void run(Args args)

stripEol

public static java.lang.String stripEol(java.lang.String string)

initialize

public void initialize(OutputDestination pReport,
                       OutputDestination pResult,
                       OutputDestination pLive,
                       OutputDestination pStatus,
                       ProgressBar pBar)

getArgs

public Args getArgs()

getFinder

public Finder getFinder()

getResultList

public java.util.List<MatchResult> getResultList()

getReportOutput

public OutputDestination getReportOutput()

getResultOutput

public OutputDestination getResultOutput()

getLiveOutput

public OutputDestination getLiveOutput()

getStatusOutput

public OutputDestination getStatusOutput()

getProgress

protected ProgressBar getProgress()

getMatchCounter

public ResultCounter getMatchCounter()

getRemainingCounter

public ResultCounter getRemainingCounter()

getFinishedCounter

public ResultCounter getFinishedCounter()

getRE

public java.util.regex.Pattern getRE()

getPattern

public java.lang.String getPattern()

getReplacement

public java.lang.String getReplacement()

isAborted

public boolean isAborted()

getAction

public mk.fsgrep.Action getAction()

totalLinesSearched

protected int totalLinesSearched()

getBackupFinder

protected Finder getBackupFinder()

setLiveOutput

public void setLiveOutput(OutputDestination val)

setMatchCounter

public void setMatchCounter(ResultCounter val)

setRemainingCounter

public void setRemainingCounter(ResultCounter val)

setFinishedCounter

public void setFinishedCounter(ResultCounter val)

setFinder

public void setFinder(Finder val)

setRE

protected void setRE(java.util.regex.Pattern val)

setReplacement

public void setReplacement(java.lang.String val)

setAborted

public void setAborted(boolean val)

totalLinesSearched

protected void totalLinesSearched(int val)

setBackupFinder

protected void setBackupFinder(Finder val)

setAction

public void setAction(mk.fsgrep.Action val)

getAlwaysRescan

public boolean getAlwaysRescan()

search

protected void search()

replace

protected void replace()

searchForPattern

protected void searchForPattern()

replacePattern

protected void replacePattern()

showMatchResult

protected void showMatchResult()

getResultFilelist

protected java.util.List<java.lang.String> getResultFilelist()

showFilelistResult

protected void showFilelistResult()

showResult

protected void showResult(Timer timer)

printMemory

protected void printMemory()

prepare

protected void prepare()

listFiles

protected void listFiles()

getMatchFlag

protected int getMatchFlag()

toString

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

run

public void run()
Specified by:
run in interface java.lang.Runnable

setPattern

public void setPattern(java.lang.String pPattern)

finishFile

public void finishFile(FileSearch fileSearch)

isActionSearch

public boolean isActionSearch()

useTransientFinder

public void useTransientFinder(Finder pFinder)

restoreFinder

public void restoreFinder()

main

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


Copyright © 2009. All Rights Reserved.