net.ultrametrics.rcs
Class Modification

java.lang.Object
  |
  +--net.ultrametrics.rcs.ControlInformation
        |
        +--net.ultrametrics.rcs.Modification

public class Modification
extends ControlInformation
implements java.lang.Comparable, Versioned

Encapsulation of an RCS source modification including a log entry describing the change and the text of the modification.


Field Summary
static java.lang.String _rcsId
           
protected static char DELIMITER
           
protected static java.lang.String LOG
           
protected static java.lang.String TEXT
           
protected static java.lang.String VERSION
           
 
Fields inherited from class net.ultrametrics.rcs.ControlInformation
_rcsId, DELIMITER, EXT_RCS, map, reader
 
Constructor Summary
Modification(java.io.BufferedReader reader, boolean isHeadRevision)
          Create a modification.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 void dump()
          Similar to toString(), but more verbose and dumps directly to stderr.
 int getAddedCount()
          Retrieve the number of lines added.
protected  java.util.Collection getAllowedKeys()
           
 java.lang.String getChanges()
          Retrieve the source changes associated with this modification.
 java.lang.String getComments()
          Retrieve the author's comments describing this modification.
 int getLineCount()
          Retrieve the total line count.
 int getRemovedCount()
          Retrieve the number of lines removed.
 java.lang.String getVersion()
          Retrieve the version number associated with this modification.
protected  boolean isKeyAllowed(java.lang.String key)
           
static void main(java.lang.String[] args)
          Tester.
 boolean parse()
          Parse a modification block.
protected  Element parseNextElement()
          Parse a single element of revision information.
protected  void setAddedCount(int added)
           
protected  void setRemovedCount(int removed)
           
 java.lang.String toString()
           
 
Methods inherited from class net.ultrametrics.rcs.ControlInformation
clear, containsKey, getElement, getFirstElement, makeKeyCollection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELIMITER

protected static char DELIMITER

VERSION

protected static final java.lang.String VERSION

LOG

protected static final java.lang.String LOG

TEXT

protected static final java.lang.String TEXT

_rcsId

public static final java.lang.String _rcsId
Constructor Detail

Modification

public Modification(java.io.BufferedReader reader,
                    boolean isHeadRevision)
Create a modification.
Parameters:
reader - the buffered reader from which the modification will be subsequently parsed.
Method Detail

getVersion

public java.lang.String getVersion()
Retrieve the version number associated with this modification.
Specified by:
getVersion in interface Versioned
Returns:
the RCS version number.

getChanges

public java.lang.String getChanges()
Retrieve the source changes associated with this modification.

Changes are annotated with diff markers so that the actualy source of this version can be constructed from the previous version plus these changes.

Returns:
the text of the source changes in diff format.

getComments

public java.lang.String getComments()
Retrieve the author's comments describing this modification.
Returns:
the text of the developer's comments.

getAddedCount

public int getAddedCount()
Retrieve the number of lines added.
Returns:
the count of the number of lines added in this modification.

getRemovedCount

public int getRemovedCount()
Retrieve the number of lines removed.
Returns:
the count of the number of lines removed in this modification.

getLineCount

public int getLineCount()
Retrieve the total line count.
Returns:
the count of the net number of lines added and removed in this modification.

setAddedCount

protected void setAddedCount(int added)

setRemovedCount

protected void setRemovedCount(int removed)

parse

public boolean parse()
              throws ParserException
Parse a modification block.

Returns:
whether this is the last revision entry in the reader
Overrides:
parse in class ControlInformation
See Also:
ControlInformation.parse()

parseNextElement

protected Element parseNextElement()
                            throws java.io.IOException,
                                   ParserException
Parse a single element of revision information.
Overrides:
parseNextElement in class ControlInformation

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

isKeyAllowed

protected boolean isKeyAllowed(java.lang.String key)
Overrides:
isKeyAllowed in class ControlInformation

getAllowedKeys

protected java.util.Collection getAllowedKeys()
Overrides:
getAllowedKeys in class ControlInformation

dump

public void dump()
Similar to toString(), but more verbose and dumps directly to stderr.
Overrides:
dump in class ControlInformation

toString

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

main

public static void main(java.lang.String[] args)
                 throws ParserException,
                        java.io.FileNotFoundException
Tester.