org.opensolaris.opengrok.search
Class Hit

java.lang.Object
  extended by org.opensolaris.opengrok.search.Hit
All Implemented Interfaces:
java.lang.Comparable

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

The hit class represents a single search hit


Constructor Summary
Hit()
          Creates a new instance of Hit
Hit(java.lang.String filename, java.lang.String line, java.lang.String lineno, boolean binary, boolean alt)
          Creates a new instance of Hit
 
Method Summary
 int compareTo(java.lang.Object o)
          Compare this object to another hit (in order to implement the comparable interface)
 boolean getAlt()
          Should this be alternate file?
 java.lang.String getDirectory()
          Getter for property directory
 java.lang.String getFilename()
          Getter for property filename.
 java.lang.String getLine()
          Getter for property line.
 java.lang.String getLineno()
          Getter for property lineno.
 java.lang.String getPath()
          Getter for property path.
 java.lang.String getTag()
          Getter for property tag.
 boolean isBinary()
          Getter for property binary.
 void setBinary(boolean binary)
          Setter for property binary.
 void setFilename(java.lang.String filename)
          Setter for property filename.
 void setLine(java.lang.String line)
          Setter for property line.
 void setLineno(java.lang.String lineno)
          Setter for property lineno.
 void setTag(java.lang.String tag)
          Setter for property tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hit

public Hit()
Creates a new instance of Hit


Hit

public Hit(java.lang.String filename,
           java.lang.String line,
           java.lang.String lineno,
           boolean binary,
           boolean alt)
Creates a new instance of Hit

Parameters:
filename - The name of the file this hit represents
line - The line containing the match
lineno - The line number in the file the match was found
binary - If this is a binary file or not
Method Detail

getFilename

public java.lang.String getFilename()
Getter for property filename.

Returns:
Value of property filename.

getPath

public java.lang.String getPath()
Getter for property path.

Returns:
Value of property path.

getDirectory

public java.lang.String getDirectory()
Getter for property directory

Returns:
Value of property directory

setFilename

public void setFilename(java.lang.String filename)
Setter for property filename.

Parameters:
filename - New value of property filename.

getLine

public java.lang.String getLine()
Getter for property line.

Returns:
Value of property line.

setLine

public void setLine(java.lang.String line)
Setter for property line.

Parameters:
line - New value of property line.

getLineno

public java.lang.String getLineno()
Getter for property lineno.

Returns:
Value of property lineno.

setLineno

public void setLineno(java.lang.String lineno)
Setter for property lineno.

Parameters:
lineno - New value of property lineno.

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compare this object to another hit (in order to implement the comparable interface)

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The object to compare this object with
Returns:
the result of a toString().compareTo() of the filename
Throws:
java.lang.ClassCastException - if o is an instance of another class than Hit

isBinary

public boolean isBinary()
Getter for property binary.

Returns:
Value of property binary.

setBinary

public void setBinary(boolean binary)
Setter for property binary.

Parameters:
binary - New value of property binary.

getTag

public java.lang.String getTag()
Getter for property tag.

Returns:
Value of property tag.

setTag

public void setTag(java.lang.String tag)
Setter for property tag.

Parameters:
tag - New value of property tag.

getAlt

public boolean getAlt()
Should this be alternate file?