org.opensolaris.opengrok.history
Class Annotation

java.lang.Object
  extended by org.opensolaris.opengrok.history.Annotation

public class Annotation
extends java.lang.Object

Class representing file annotation, i.e., revision and author for the last modification of each line in the file.


Constructor Summary
Annotation(java.lang.String filename)
           
 
Method Summary
 java.lang.String getAuthor(int line)
          Gets the author who last modified the specified line.
 java.lang.String getFilename()
           
 java.lang.String getRevision(int line)
          Gets the revision for the last change to the specified line.
 int getWidestAuthor()
          Returns the widest author name in the file (used for pretty printing).
 int getWidestRevision()
          Returns the widest revision string in the file (used for pretty printing).
 boolean isEnabled(int line)
          Gets the enabled state for the last change to the specified line.
 int size()
          Returns the size of the file (number of lines).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Annotation

public Annotation(java.lang.String filename)
Method Detail

getRevision

public java.lang.String getRevision(int line)
Gets the revision for the last change to the specified line.

Parameters:
line - line number (counting from 1)
Returns:
revision string, or an empty string if there is no information about the specified line

getAuthor

public java.lang.String getAuthor(int line)
Gets the author who last modified the specified line.

Parameters:
line - line number (counting from 1)
Returns:
author, or an empty string if there is no information about the specified line

isEnabled

public boolean isEnabled(int line)
Gets the enabled state for the last change to the specified line.

Parameters:
line - line number (counting from 1)
Returns:
true if the xref for this revision is enabled, false otherwise

size

public int size()
Returns the size of the file (number of lines).

Returns:
number of lines

getWidestRevision

public int getWidestRevision()
Returns the widest revision string in the file (used for pretty printing).

Returns:
number of characters in the widest revision string

getWidestAuthor

public int getWidestAuthor()
Returns the widest author name in the file (used for pretty printing).

Returns:
number of characters in the widest author string

getFilename

public java.lang.String getFilename()