|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.jrcs.util.ToString
org.apache.commons.jrcs.rcs.Version
public class Version
Contains and manages a version number of the form "x(\.y)*". This class is NOT thread safe.
Archive| Field Summary | |
|---|---|
private int[] |
numbers
|
| Constructor Summary | |
|---|---|
Version()
Create an empty version number. |
|
Version(int major)
Creates a new Version with a single digit version number |
|
Version(int[] num)
Converts an array of int to a Version. |
|
Version(java.lang.Integer[] num)
Converts an array of Integer to a Version. |
|
Version(int major,
int minor)
Creates a new Version with a major.minor version number. |
|
Version(java.lang.String v)
Converts string to a version. |
|
Version(Version v)
Create a new Version by copying another. |
|
| Method Summary | |
|---|---|
protected void |
__addBranch(int branch)
|
protected void |
__addBranch(java.lang.Integer branch)
|
int |
at(int pos)
Return the version number at the given position. |
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object other)
Compares two versions in lexigographical order. |
int |
compareVersions(Version ver)
Compares two versions. |
boolean |
equals(java.lang.Object o)
Determine if two versions are equal. |
boolean |
even()
|
boolean |
even(int n)
|
Version |
getBase(int positions)
Return the last number in the version number. |
Version |
getBranchPoint()
|
int[] |
getNumbers()
Return the current version number as an array of int. |
int |
hashCode()
|
boolean |
isBranch()
|
boolean |
isGhost()
|
boolean |
isGreaterOrEqualThan(Version ver)
Determine if this version is greater than or equal to the given one. |
boolean |
isGreaterThan(Version ver)
Determine if this version is greater than the given one. |
boolean |
isLessOrEqualThan(Version ver)
Determine if this version is less than or equal to the given one. |
boolean |
isLessThan(Version ver)
Determine if this version is less than the given one. |
boolean |
isRevision()
|
boolean |
isTrunk()
|
int |
last()
Return the last number in the version number. |
Version |
newBranch(int branch)
|
Version |
next()
|
boolean |
odd()
|
boolean |
odd(int n)
|
int |
size()
|
void |
toString(java.lang.StringBuffer s)
Place a string image of the object in a StringBuffer. |
| Methods inherited from class org.apache.commons.jrcs.util.ToString |
|---|
arrayToString, arrayToString, stringToArray, stringToArraya, stringToArrayold, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int[] numbers
| Constructor Detail |
|---|
public Version(int major)
major - the version number
public Version(int major,
int minor)
major - the major version numbermajor - the minor version numberpublic Version(java.lang.Integer[] num)
num - an array of Integerspublic Version(int[] num)
num - an array of int
public Version(java.lang.String v)
throws InvalidVersionNumberException
v - a string accepted by the following regular expression.
[0-9]+(.[0-9]+)*
InvalidVersionNumberException - if the string cannot be parsedpublic Version(Version v)
v - the version to copypublic Version()
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.lang.Objectpublic int[] getNumbers()
public int compareVersions(Version ver)
ver - the version to compare to.
public int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparableother - The version to compare tocompareVersions(org.apache.commons.jrcs.rcs.Version)public boolean isGreaterThan(Version ver)
ver - the version to compare to.
compareVersions(org.apache.commons.jrcs.rcs.Version)public boolean isGreaterOrEqualThan(Version ver)
ver - the version to compare to.
compareVersions(org.apache.commons.jrcs.rcs.Version)public boolean isLessThan(Version ver)
ver - the version to compare to.
compareVersions(org.apache.commons.jrcs.rcs.Version)public boolean isLessOrEqualThan(Version ver)
ver - the version to compare to.
compareVersions(org.apache.commons.jrcs.rcs.Version)public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the version to compare to
public int hashCode()
hashCode in class java.lang.Objectpublic int at(int pos)
pos - the position.
public int last()
public Version getBase(int positions)
public Version getBranchPoint()
public Version next()
protected void __addBranch(java.lang.Integer branch)
protected void __addBranch(int branch)
public Version newBranch(int branch)
public int size()
public boolean isTrunk()
public boolean isBranch()
public boolean isRevision()
public boolean isGhost()
public boolean even(int n)
public boolean even()
public boolean odd(int n)
public boolean odd()
public void toString(java.lang.StringBuffer s)
ToString
toString in class ToStrings - the string buffer.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||