|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.toolforge.karma.core.Version
A Version
is the container object for the version
attribute of a module. The implementation
is independent of the version control system.
Field Summary | |
static int |
FIRST_DIGIT
|
static Version |
INITIAL_VERSION
The initial version for a module. |
static int |
SECOND_DIGIT
|
static int |
THIRD_DIGIT
|
static java.lang.String |
VERSION_PATTERN_STRING
|
static java.lang.String |
VERSION_SEPARATOR_CHAR
Separator for version digits. |
Constructor Summary | |
Version(int[] versionDigits)
Constructs a version number concatenating each item in versionDigits , using the '-'
separator. |
|
Version(java.lang.String versionIdentifier)
Constructs a version number using the versionIdentifier parameter. |
Method Summary | |
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object o)
Compares two Version instances. |
Patch |
createPatch(int patchNumber)
Creates a Patch based on this version. |
boolean |
equals(java.lang.Object o)
|
protected static Version |
getInitialVersion()
Returns the initial version for a module. |
java.lang.String |
getPatternString()
|
java.lang.String |
getVersionNumber()
|
int |
hashCode()
|
void |
increase()
Increases this versions' last digit by 1. |
void |
increaseMajor()
Increases this Version to the next major version by increasing the first digit of the version and setting the second digit to "0". |
boolean |
isHigherThan(Version version)
|
boolean |
isLowerThan(Version version)
|
void |
setDigit(int index,
int nextDigit)
|
java.lang.String |
toString()
Gets the string representation of this version. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static java.lang.String VERSION_PATTERN_STRING
public static final java.lang.String VERSION_SEPARATOR_CHAR
public static Version INITIAL_VERSION
public static final int FIRST_DIGIT
public static final int SECOND_DIGIT
public static final int THIRD_DIGIT
Constructor Detail |
public Version(java.lang.String versionIdentifier)
versionIdentifier
parameter.
versionIdentifier
- public Version(int[] versionDigits)
versionDigits
, using the '-'
separator. {1, 0, 9}
translates into a version number 1-0-9
.
versionDigits
- An array, containing all version components (maximum of three is allowed).Method Detail |
public java.lang.String getPatternString()
protected static Version getInitialVersion()
new Version("0-0")
.
public Patch createPatch(int patchNumber)
Patch
based on this version.
patchNumber
-
public java.lang.String getVersionNumber()
public java.lang.String toString()
public final int hashCode()
public final boolean equals(java.lang.Object o)
public final int compareTo(java.lang.Object o)
Version
instances.
compareTo
in interface java.lang.Comparable
o
- The other Version
instance to match against.
-1
when this < o
, 0
when
this == o
or 1
when this > o
.public void setDigit(int index, int nextDigit)
public final boolean isLowerThan(Version version)
public final boolean isHigherThan(Version version)
public final void increase()
public void increaseMajor()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |