org.jutil.junit
Interface Revision

All Known Implementing Classes:
AbstractRevision

public interface Revision

A class of Revisions of something.

An example of a revision is software revison. A revision consists of a sequence of numbers. The first three numbers are called "major", "minor" and "micro". Further numbers have no name.

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

Field Summary
static java.lang.String CVS_REVISION
           
 
Method Summary
 boolean equals(java.lang.Object other)
          public behavior

post (! (other instanceof Revision)) ==> (\result == false);
post (other instanceof Revision) ==> \result ==
(\forall int i; i>=1;
getNumber(i) == ((Revision)other).getNumber(i));
Check whether or not this revision is equal to another
 int getMajor()
          public behavior

post \result == getNumber(1);
Return the major number of this Revision.
 int getMicro()
          public behavior

post \result == getNumber(3);
Return the micro number of this Revision.
 int getMinor()
          public behavior

post \result == getNumber(2);
Return the minor number of this Revision.
 int getNumber(int index)
          pre index >= 1;

post \result >=0;
post (index > length()) ==> (\result == 0);
Return the index'th number of this Revision.
 int length()
          public behavior

post \result >= 1;
Return the number of numbers in this Revision.
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
Method Detail

getMajor

public int getMajor()
public behavior

post \result == getNumber(1);
Return the major number of this Revision.

getMinor

public int getMinor()
public behavior

post \result == getNumber(2);
Return the minor number of this Revision.

getMicro

public int getMicro()
public behavior

post \result == getNumber(3);
Return the micro number of this Revision.

getNumber

public int getNumber(int index)
pre index >= 1;

post \result >=0;
post (index > length()) ==> (\result == 0);
Return the index'th number of this Revision.
Parameters:
index - The index of the requested number.

length

public int length()
public behavior

post \result >= 1;
Return the number of numbers in this Revision.

equals

public boolean equals(java.lang.Object other)
public behavior

post (! (other instanceof Revision)) ==> (\result == false);
post (other instanceof Revision) ==> \result ==
(\forall int i; i>=1;
getNumber(i) == ((Revision)other).getNumber(i));
Check whether or not this revision is equal to another
Overrides:
equals in class java.lang.Object
Parameters:
other - The other revision.