org.jutil.junit
Class CVSRevision

java.lang.Object
  |
  +--org.jutil.junit.AbstractRevision
        |
        +--org.jutil.junit.CVSRevision
All Implemented Interfaces:
Revision

public class CVSRevision
extends AbstractRevision

A class of CVS revisions. A revision is created using the string that CVS uses to save version information in a file.

Version:
$Revision: 1.4 $
Author:
Marko van Dooren

Field Summary
static java.lang.String CVS_REVISION
           
 
Constructor Summary
CVSRevision(java.lang.String revision)
          public behavior

pre revision != null;
// The revision must either be a revision number, or a CVS revision string.
// In other words : "x.x.x.x" or "$Revision: 1.4 $".
pre new Pattern("\\d*(\\.(\\d)*)*").matcher(revision).matches() ||
new Pattern("$Revision: 1.4 $").matcher(revision).matches();

post (* number i == the i'th x *);
Initialize a new CVSRevision with the given String.
 
Method Summary
 int getNumber(int index)
          See superclass.
 int length()
          See superclass.
 
Methods inherited from class org.jutil.junit.AbstractRevision
equals, getMajor, getMicro, getMinor, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
Constructor Detail

CVSRevision

public CVSRevision(java.lang.String revision)
public behavior

pre revision != null;
// The revision must either be a revision number, or a CVS revision string.
// In other words : "x.x.x.x" or "$Revision: 1.4 $".
pre new Pattern("\\d*(\\.(\\d)*)*").matcher(revision).matches() ||
new Pattern("$Revision: 1.4 $").matcher(revision).matches();

post (* number i == the i'th x *);
Initialize a new CVSRevision with the given String.
Parameters:
revision - A String representing the CVS revision. This is the string the CVS itself uses. The format is "$Revision: 1.4 $", where x is the version number, or just "1.3.234.1.5" or so . The format is more formally described in the preconditions.
Method Detail

getNumber

public int getNumber(int index)
See superclass.
Following copied from interface: org.jutil.junit.Revision
Parameters:
index - The index of the requested number.

length

public int length()
See superclass.