|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.platform.plugin.Version
public class Version
Class to encapsulate the versioning in a plug-in and within the application. Versions include major, minor, patch, and build numbers, typically represented as "n.n.n.n". Comparisons go from from left to right, i.e., major to build. Since older versions did not include the concept of "build" number, the old style major, minor, patch is still supported. Undefined values for build are not evaluated.
Field Summary | |
---|---|
static java.lang.String |
DELIMITER
Static value for string construction and parsing. |
static int |
EQUALS
Static value for compare() method return value. |
static int |
GREATER_THAN
Static value for compare() method return value. |
static int |
LESS_THAN
Static value for compare() method return value. |
static int |
UNDEFINED
Static value for unset value. |
Constructor Summary | |
---|---|
Version(int maj,
int min,
int p)
Constructor taking major, minor, patch number components. |
|
Version(int maj,
int min,
int p,
int b)
Constructor taking all four build components. |
Method Summary | |
---|---|
int |
compare(Version v)
Method to evaluate two versions. |
int |
getBuild()
Returns the build version number, the fourth number in a string of the form N.N.N.N |
int |
getMajor()
Returns the major version number, the first number in a string of the form N.N.N.N |
int |
getMinor()
Returns the minor version number, the second number in a string of the form N.N.N.N |
int |
getPatch()
Returns the patch version number, the third number in a string of the form N.N.N.N |
static Version |
parse(java.lang.String str)
Parses a string of the form "n.n.n.n" into a Version object. |
java.lang.String |
toString()
Simple method to return version as a string of the form "n.n.n.n". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int GREATER_THAN
public static final int LESS_THAN
public static final int EQUALS
public static final int UNDEFINED
public static final java.lang.String DELIMITER
Constructor Detail |
---|
public Version(int maj, int min, int p)
maj
- Major version numbermin
- Minor version numberp
- Path (or revision) version numberpublic Version(int maj, int min, int p, int b)
maj
- Major version numbermin
- Minor version numberp
- Path (or revision) version numberb
- Build version number.Method Detail |
---|
public int getMajor()
public int getMinor()
public int getPatch()
public int getBuild()
public java.lang.String toString()
toString
in class java.lang.Object
public int compare(Version v)
v
- Version to compare against
public static Version parse(java.lang.String str) throws VersionException
compare( Version )
for information on the effect this has on comparing
two versions.
str
- String to parse
VersionException
- thrown If there are fewer than two version elements, or if any
of the elements generates a parse exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |