org.oddjob.io
Class GrepLineResult

java.lang.Object
  extended by org.oddjob.io.GrepLineResult
All Implemented Interfaces:
Serializable

public class GrepLineResult
extends Object
implements Serializable

A Java bean to contain the result of a single line match for from the GrepJob

See Also:
Serialized Form
Author:
rob

Constructor Summary
GrepLineResult(File file, int lineNumber, String line, String match)
          Constructor for a result from a file.
GrepLineResult(int lineNumber, String line, String match)
          Constructor for a result not from a file.
 
Method Summary
 File getFile()
          The file containing the match, if the match was from a file.
 String getLine()
          The line of text containing the match.
 int getLineNumber()
          The line number in the file or input stream the match was on.
 String getMatch()
          The text section of the line that provided the match.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrepLineResult

public GrepLineResult(int lineNumber,
                      String line,
                      String match)
Constructor for a result not from a file.

Parameters:
lineNumber -
line -
match -

GrepLineResult

public GrepLineResult(File file,
                      int lineNumber,
                      String line,
                      String match)
Constructor for a result from a file.

Parameters:
lineNumber -
line -
match -
Method Detail

getFile

public File getFile()
The file containing the match, if the match was from a file.

Returns:
The file. Null if the match was not from a file.

getLineNumber

public int getLineNumber()
The line number in the file or input stream the match was on.

Returns:
The line number.

getLine

public String getLine()
The line of text containing the match.

Returns:
The line. Never null.

getMatch

public String getMatch()
The text section of the line that provided the match.

Returns:
The match. Match will be null if the result was from an inverted search..