gov.llnl.babel.symbols
public class Version extends java.lang.Object
Version
represents a symbol version of the general
form "V1.V2...Vn" where Vi is a non-negative integer. Trailing zeros
in the version number are not significant. That is, "1.2" is the same
as "1.2.0" and "1.2.0.0.0".Constructor and Description |
---|
Version()
Create a new
Version class that will be constructed
through member function appendVersionNumber . |
Version(java.lang.String version)
Create a new
Version class by parsing a version string
of the form "V1.V2...Vn" where each Vi is a non-negative integer. |
Modifier and Type | Method and Description |
---|---|
void |
appendVersionNumber(int v)
Add another version number to the existing version description.
|
int |
getVersionLength()
Return the number of sub-parts in the version description.
|
int |
getVersionNumberAt(int i)
Return the version number at a particular location of the version
string using zero-based indexing.
|
java.lang.String |
getVersionString()
Return the current version description as a version string.
|
int |
hashCode()
Return a hash code for a version.
|
boolean |
isGreaterThan(Version other)
Return whether this version is greater than the version in the
argument.
|
boolean |
isSame(Version other)
Return whether two version objects represent the same version
number.
|
boolean |
isUnspecified() |
public Version()
Version
class that will be constructed
through member function appendVersionNumber
. An empty
version is considered to be version "0".public Version(java.lang.String version) throws java.lang.NumberFormatException
Version
class by parsing a version string
of the form "V1.V2...Vn" where each Vi is a non-negative integer.
If the version is not of this form, then the constructor throws a
NumberFormatException
.java.lang.NumberFormatException
public void appendVersionNumber(int v)
NumberFormatException
is
thrown.public java.lang.String getVersionString()
public int getVersionLength()
public boolean isUnspecified()
public int getVersionNumberAt(int i)
public boolean isSame(Version other)
public boolean isGreaterThan(Version other)
public int hashCode()
hashCode
in class java.lang.Object