Package com.bc.ceres.core.runtime
Class Version
- java.lang.Object
-
- com.bc.ceres.core.runtime.Version
-
- All Implemented Interfaces:
Comparable
public class Version extends Object implements Comparable
Represents a version identifier.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcompare(Version v1, Version v2)intcompareTo(Object o)booleanequals(Object obj)intgetMajor()intgetMicro()intgetMinor()intgetNumber(int i)intgetNumberCount()StringgetQualifier()inthashCode()static VersionparseVersion(String text)Parses a version text in the form{<number><sep>}[<qualifier>], where <sep> is one of '.', '-' or '_'.StringtoString()Returns the string representation of the version in the form{major}.{minor}.{micro}-{qualifier}.
-
-
-
Constructor Detail
-
Version
public Version(int major, int minor, int micro, String qualifier)
-
-
Method Detail
-
parseVersion
public static Version parseVersion(String text)
Parses a version text in the form{<number><sep>}[<qualifier>], where <sep> is one of '.', '-' or '_'. If no number was found1.[<qualifier>]is assumed, e.g. "M1", is the same as "1.0.0.M1".- Parameters:
text- the text to parse- Returns:
- the version identifier
-
getNumberCount
public int getNumberCount()
-
getNumber
public int getNumber(int i)
-
getMajor
public int getMajor()
-
getMinor
public int getMinor()
-
getMicro
public int getMicro()
-
getQualifier
public String getQualifier()
-
toString
public String toString()
Returns the string representation of the version in the form{major}.{minor}.{micro}-{qualifier}.
-
compareTo
public int compareTo(Object o)
- Specified by:
compareToin interfaceComparable
-
-