com.borland.primetime.teamdev.vcs
Class AbstractRevisionNumber
java.lang.Object
|
+--com.borland.primetime.teamdev.vcs.AbstractRevisionNumber
- All Implemented Interfaces:
- java.lang.Comparable
- Direct Known Subclasses:
- NumericRevisionNumber, StringRevisionNumber
- public abstract class AbstractRevisionNumber
- extends java.lang.Object
- implements java.lang.Comparable
Abstract class to store revision numbers both as gorups of digits (i.e. 1.1.3.1)
and as strings (i.e., ~42~). The class also implements the Comparable
interface to make it easy to sort RevisionInfo
objects consistently
(for example, 1.10 comes after 1.2 and ~xx~ come always before any x.y kind of
revision number).
Any subclass has to implement the doComparison()
method to return the
same value returned by Comparable.compareTo()
. When this method is called
it's guaranteed to receive a subclass of the same type for the first parameter so the
comparison can use directly the storage type implemented by the subclass.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractRevisionNumber
public AbstractRevisionNumber()
getRevisionString
public abstract java.lang.String getRevisionString()
getPrecedence
public abstract int getPrecedence()
doComparison
public abstract int doComparison(AbstractRevisionNumber arn)
compareTo
public int compareTo(java.lang.Object o2)
- Specified by:
compareTo
in interface java.lang.Comparable
getRevisionNumberInstance
public static AbstractRevisionNumber getRevisionNumberInstance(java.lang.String revNumber)