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.


Field Summary
static java.lang.String CVS_REVISION
           
 
Method Summary
abstract  boolean equals(java.lang.Object other)
          Check whether or not this revision is equal to another
abstract  int getMajor()
          Return the major number of this Revision.
abstract  int getMicro()
          Return the micro number of this Revision.
abstract  int getMinor()
          Return the minor number of this Revision.
abstract  int getNumber(int index)
          Return the index'th number of this Revision.
abstract  int length()
          Return the number of numbers in this Revision.
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
Method Detail

getMajor

public abstract int getMajor()
Return the major number of this Revision.

Specifications:
public behavior
ensures \result == getNumber(1);

getMinor

public abstract int getMinor()
Return the minor number of this Revision.

Specifications:
public behavior
ensures \result == getNumber(2);

getMicro

public abstract int getMicro()
Return the micro number of this Revision.

Specifications:
public behavior
ensures \result == getNumber(3);

getNumber

public abstract int getNumber(int index)
Return the index'th number of this Revision.

Parameters:
index - The index of the requested number.

Specifications:
requires index >= 1;
ensures \result >= 0;
ensures (index > length()) ==> (\result == 0);

length

public abstract int length()
Return the number of numbers in this Revision.

Specifications:
public behavior
ensures \result >= 1;

equals

public abstract boolean equals(java.lang.Object other)
Check whether or not this revision is equal to another

Overrides:
equals in class java.lang.Object
Parameters:
other - The other revision.

Specifications:
     also
public behavior
ensures (!(other instanceof Revision)) ==> (\result == false);
ensures (other instanceof Revision) ==> \result == ( \forall int i; i >= 1; getNumber(i) == ((Revision)other).getNumber(i));