public class Version extends ToString implements java.lang.Cloneable, java.lang.Comparable
Archive
Modifier and Type | Field and Description |
---|---|
private int[] |
numbers |
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
arrayToString, arrayToString, stringToArray, stringToArraya, stringToArrayold, toString
public Version(int major)
major
- the version numberpublic 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 intpublic 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()
public java.lang.Object clone()
clone
in class java.lang.Object
public 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.Comparable
other
- 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.Object
o
- the version to compare topublic int hashCode()
hashCode
in class java.lang.Object
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(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()
Copyright 2002 the Apache Software Foundation
Copyright ? 1999-2001 Juancarlo A?ez, Caracas, Venezuela.
All rights reserved
. http://www.suigeneris.org/jrcs