com.stevesoft.pat.apps
Class Grep

java.lang.Object
  |
  +--com.stevesoft.pat.apps.Grep

public class Grep
extends java.lang.Object

This provides the functionality of the UNIX utility grep. Options:

  1. -i : ignore case
  2. -p : paragraph based matching
  3. -v : invert, print only lines that don't match


Constructor Summary
Grep()
           

 
Method Summary
 boolean getIFlag()
          The ignore case flag
 boolean getPFlag()
          The paragraph mode flag
 Regex getRegex()
          The pattern to be searched for
 boolean getVerbose()
          Determine if file and line number info is written.
 boolean getVFlag()
          If the vflag is true, then only lines not matching the supplied pattern will be printed.
static void main(java.lang.String[] args)
           
 void setIFlag(boolean b)
          The ignore case flag
 void setPFlag(boolean b)
          The paragraph mode flag
 void setRegex(Regex r)
          The pattern to be searched for
 void setVerbose(boolean b)
          Determine if file and line number info is written.
 void setVFlag(boolean b)
          If the vflag is true, then only lines not matching the supplied pattern will be printed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Grep

public Grep()
Method Detail

main

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

getIFlag

public boolean getIFlag()
The ignore case flag

setIFlag

public void setIFlag(boolean b)
The ignore case flag

getPFlag

public boolean getPFlag()
The paragraph mode flag

setPFlag

public void setPFlag(boolean b)
The paragraph mode flag

getVFlag

public boolean getVFlag()
If the vflag is true, then only lines not matching the supplied pattern will be printed.

setVFlag

public void setVFlag(boolean b)
If the vflag is true, then only lines not matching the supplied pattern will be printed.

getVerbose

public boolean getVerbose()
Determine if file and line number info is written.

setVerbose

public void setVerbose(boolean b)
Determine if file and line number info is written.

setRegex

public void setRegex(Regex r)
The pattern to be searched for

getRegex

public Regex getRegex()
The pattern to be searched for