| |
|
| java.lang.Object org.apache.commons.jrcs.util.ToString org.apache.commons.jrcs.rcs.Version
Version | public class Version extends ToString implements Cloneable,Comparable(Code) | | Contains and manages a version number of the form "x(\.y)*".
This class is NOT thread safe.
See Also: Archive author: Juanco Anez version: $Id: Version.java 2967 2005-10-26 10:52:33Z ian@caret.cam.ac.uk $ |
Constructor Summary | |
public | Version(int major) | public | Version(int major, int minor) Creates a new Version with a major.minor version number. | public | Version(Integer[] num) Converts an array of Integer to a Version. | public | Version(int[] num) Converts an array of int to a Version. | public | Version(String v) Converts string to a version. | public | Version(Version v) Create a new Version by copying another. | public | Version() Create an empty version number. |
Method Summary | |
protected void | __addBranch(Integer branch) | protected void | __addBranch(int branch) | public int | at(int pos) Return the version number at the given position.
Parameters: pos - the position. | public Object | clone() | public int | compareTo(Object other) Compares two versions in lexigographical order.
Unlike compareVersions, this comparison is not done in
the way usual for versions numbers. | public int | compareVersions(Version ver) Compares two versions.
The comparison is done the usual way, i.e., 2.0 is greter than 1.99.1,
and 0.1.2 is greater than 0.1
Parameters: ver - the version to compare to. | public boolean | equals(Object o) Determine if two versions are equal. | public boolean | even(int n) | public boolean | even() | public Version | getBase(int positions) Return the last number in the version number. | public Version | getBranchPoint() | public int[] | getNumbers() Return the current version number as an array of int. | public int | hashCode() | public boolean | isBranch() | public boolean | isGhost() | public boolean | isGreaterOrEqualThan(Version ver) Determine if this version is greater than or equal to the given one.
Parameters: ver - the version to compare to. | public boolean | isGreaterThan(Version ver) Determine if this version is greater than the given one.
Parameters: ver - the version to compare to. | public boolean | isLessOrEqualThan(Version ver) Determine if this version is less than or equal to the given one.
Parameters: ver - the version to compare to. | public boolean | isLessThan(Version ver) Determine if this version is less than the given one.
Parameters: ver - the version to compare to. | public boolean | isRevision() | public boolean | isTrunk() | public int | last() Return the last number in the version number. | public Version | newBranch(int branch) | public Version | next() | public boolean | odd(int n) | public boolean | odd() | public int | size() | public void | toString(StringBuffer s) |
Version | public Version(int major)(Code) | | Creates a new Version with a single digit version number
Parameters: major - the version number |
Version | public Version(int major, int minor)(Code) | | Creates a new Version with a major.minor version number.
Parameters: major - the major version number Parameters: major - the minor version number |
Version | public Version(Integer[] num)(Code) | | Converts an array of Integer to a Version.
Parameters: num - an array of Integers |
Version | public Version(int[] num)(Code) | | Converts an array of int to a Version.
Parameters: num - an array of int |
Version | public Version(Version v)(Code) | | Create a new Version by copying another.
Parameters: v - the version to copy |
Version | public Version()(Code) | | Create an empty version number.
|
__addBranch | protected void __addBranch(int branch)(Code) | | |
at | public int at(int pos)(Code) | | Return the version number at the given position.
Parameters: pos - the position. the number. |
compareTo | public int compareTo(Object other)(Code) | | Compares two versions in lexigographical order.
Unlike compareVersions, this comparison is not done in
the way usual for versions numbers. The order relationship
stablished here is the one CVS used to store nodes into archive
files.
Parameters: other - The version to compare to See Also: Version.compareVersions |
compareVersions | public int compareVersions(Version ver)(Code) | | Compares two versions.
The comparison is done the usual way, i.e., 2.0 is greter than 1.99.1,
and 0.1.2 is greater than 0.1
Parameters: ver - the version to compare to. 0 if this == ver, 1 if this greater than ver, -1 otherwise. |
equals | public boolean equals(Object o)(Code) | | Determine if two versions are equal.
Parameters: o - the version to compare to true if both versions represent the same version number |
even | public boolean even(int n)(Code) | | |
even | public boolean even()(Code) | | |
getBase | public Version getBase(int positions)(Code) | | Return the last number in the version number.
the number. |
getNumbers | public int[] getNumbers()(Code) | | Return the current version number as an array of int.
the current version number as an array of int. |
hashCode | public int hashCode()(Code) | | |
isBranch | public boolean isBranch()(Code) | | |
isGhost | public boolean isGhost()(Code) | | |
isGreaterOrEqualThan | public boolean isGreaterOrEqualThan(Version ver)(Code) | | Determine if this version is greater than or equal to the given one.
Parameters: ver - the version to compare to. true if compareVersions(ver) >= 0 See Also: Version.compareVersions |
isGreaterThan | public boolean isGreaterThan(Version ver)(Code) | | Determine if this version is greater than the given one.
Parameters: ver - the version to compare to. true if compareVersions(ver) > 0 See Also: Version.compareVersions |
isLessOrEqualThan | public boolean isLessOrEqualThan(Version ver)(Code) | | Determine if this version is less than or equal to the given one.
Parameters: ver - the version to compare to. true if compareVersions(ver) <= 0 See Also: Version.compareVersions |
isLessThan | public boolean isLessThan(Version ver)(Code) | | Determine if this version is less than the given one.
Parameters: ver - the version to compare to. true if compareVersions(ver) < 0 See Also: Version.compareVersions |
isRevision | public boolean isRevision()(Code) | | |
isTrunk | public boolean isTrunk()(Code) | | |
last | public int last()(Code) | | Return the last number in the version number.
the number. |
odd | public boolean odd(int n)(Code) | | |
|
|
|