|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ten60.netkernel.util.Version
Contains and manages a version number of the form "x(\.y)*". This class is NOT thread safe.
Archive
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(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(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(Integer branch)
|
int |
at(int pos)
Return the version number at the given position. |
Object |
clone()
|
int |
compareTo(Object other)
Compares two versions in lexigographical order. |
int |
compareVersions(Version ver)
Compares two versions. |
boolean |
equals(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()
|
String |
toString()
|
String |
toString(int aMinLength)
|
void |
toString(StringBuffer s,
int aMinLength)
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Version(int major)
major
- the version numberpublic Version(int major, int minor)
major
- the major version numberpublic Version(Integer[] num)
num
- an array of Integerspublic Version(int[] num)
num
- an array of intpublic Version(String v) throws NumberFormatException
v
- a string accepted by the following regular expression.
[0-9]+(.[0-9]+)*
InvalidVersionNumberException
- if the string cannot be parsed
NumberFormatException
public Version(Version v)
v
- the version to copypublic Version()
Method Detail |
public Object clone()
public int[] getNumbers()
public int compareVersions(Version ver)
ver
- the version to compare to.
public int compareTo(Object other)
compareTo
in interface Comparable
other
- The version to compare tocompareVersions(com.ten60.netkernel.util.Version)
public boolean isGreaterThan(Version ver)
ver
- the version to compare to.
compareVersions(com.ten60.netkernel.util.Version)
public boolean isGreaterOrEqualThan(Version ver)
ver
- the version to compare to.
compareVersions(com.ten60.netkernel.util.Version)
public boolean isLessThan(Version ver)
ver
- the version to compare to.
compareVersions(com.ten60.netkernel.util.Version)
public boolean isLessOrEqualThan(Version ver)
ver
- the version to compare to.
compareVersions(com.ten60.netkernel.util.Version)
public boolean equals(Object o)
o
- the version to compare to
public int hashCode()
public int at(int pos)
pos
- the position.
public int last()
public Version getBase(int positions)
public Version getBranchPoint()
public Version next()
protected void __addBranch(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(StringBuffer s, int aMinLength)
public String toString()
public String toString(int aMinLength)
|
NetKernel APIs |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |