jaulib v1.3.0
Jau Support Library (C++, Java, ..)
|
Simple version number class containing a version number either being defined explicit
or derived from a string
.
More...
Public Member Functions | |
VersionNumber (final int majorRev, final int minorRev, final int subMinorRev) | |
Explicit version number instantiation, with all components defined explicitly. More... | |
VersionNumber (final String versionString) | |
String derived version number instantiation. More... | |
VersionNumber (final String versionString, final String delim) | |
String derived version number instantiation. More... | |
VersionNumber (final String versionString, final java.util.regex.Pattern versionPattern) | |
String derived version number instantiation. More... | |
final boolean | isZero () |
Returns true , if all version components are zero, otherwise false . More... | |
final boolean | hasMajor () |
Returns true , if the major component is defined explicitly, otherwise false . More... | |
final boolean | hasMinor () |
Returns true , if the optional minor component is defined explicitly, otherwise false . More... | |
final boolean | hasSub () |
Returns true , if the optional sub component is defined explicitly, otherwise false . More... | |
final int | endOfStringMatch () |
If constructed with version-string , returns the string offset after the last matching character, or 0 if none matched, or -1 if not constructed with a string. More... | |
final int | hashCode () |
final boolean | equals (final Object o) |
final int | compareTo (final Object o) |
final int | compareTo (final VersionNumber vo) |
final int | getMajor () |
final int | getMinor () |
final int | getSub () |
String | toString () |
Static Public Member Functions | |
static java.util.regex.Pattern | getVersionNumberPattern (final String delim) |
Returns the pattern with Perl regular expression: More... | |
static java.util.regex.Pattern | getDefaultVersionNumberPattern () |
Returns the default pattern using getVersionNumberPattern(String) with delimiter "<b>.</b>". More... | |
Static Public Attributes | |
static final VersionNumber | zeroVersion = new VersionNumber(0, 0, 0, -1, (short)0) |
A zero version instance, w/o any component defined explicitly. More... | |
Protected Member Functions | |
VersionNumber (final int majorRev, final int minorRev, final int subMinorRev, final int _strEnd, final short _state) | |
Protected Attributes | |
final int | major |
final int | minor |
final int | sub |
final int | strEnd |
final short | state |
Static Protected Attributes | |
static final short | HAS_MAJOR = 1 << 0 |
static final short | HAS_MINOR = 1 << 1 |
static final short | HAS_SUB = 1 << 2 |
Simple version number class containing a version number either being defined explicit
or derived from a string
.
For the latter case, you can query whether a component has been defined explicitly by the given versionString
, via hasMajor()
, hasMinor()
and hasSub()
.
The state whether a component is defined explicitly is not considered in the hashCode()
, equals(Object)
or compareTo(Object)
methods, since the version number itself is treated regardless.
Definition at line 45 of file VersionNumber.java.
|
protected |
Definition at line 103 of file VersionNumber.java.
org.jau.util.VersionNumber.VersionNumber | ( | final int | majorRev, |
final int | minorRev, | ||
final int | subMinorRev | ||
) |
Explicit version number instantiation, with all components defined explicitly.
Definition at line 117 of file VersionNumber.java.
org.jau.util.VersionNumber.VersionNumber | ( | final String | versionString | ) |
String derived version number instantiation.
Utilizing the default pattern
parser with delimiter "<b>.</b>", see getDefaultVersionNumberPattern()
.
You can query whether a component has been defined explicitly by the given versionString
, via hasMajor()
, hasMinor()
and hasSub()
.
versionString | should be given as [MAJOR[.MINOR[.SUB]]] |
Definition at line 136 of file VersionNumber.java.
org.jau.util.VersionNumber.VersionNumber | ( | final String | versionString, |
final String | delim | ||
) |
String derived version number instantiation.
Utilizing pattern
parser created via getVersionNumberPattern(String)
.
You can query whether a component has been defined explicitly by the given versionString
, via hasMajor()
, hasMinor()
and hasSub()
.
versionString | should be given as [MAJOR[.MINOR[.SUB]]] |
delim | the delimiter, e.g. "." |
Definition at line 156 of file VersionNumber.java.
org.jau.util.VersionNumber.VersionNumber | ( | final String | versionString, |
final java.util.regex.Pattern | versionPattern | ||
) |
String derived version number instantiation.
You can query whether a component has been defined explicitly by the given versionString
, via hasMajor()
, hasMinor()
and hasSub()
.
versionString | should be given as [MAJOR[.MINOR[.SUB]]] |
versionPattern | the pattern parser, must be compatible w/ getVersionNumberPattern(String) |
Definition at line 173 of file VersionNumber.java.
final int org.jau.util.VersionNumber.compareTo | ( | final Object | o | ) |
Definition at line 242 of file VersionNumber.java.
final int org.jau.util.VersionNumber.compareTo | ( | final VersionNumber | vo | ) |
Definition at line 250 of file VersionNumber.java.
final int org.jau.util.VersionNumber.endOfStringMatch | ( | ) |
If constructed with version-string
, returns the string offset after the last matching character, or 0
if none matched, or -1
if not constructed with a string.
Definition at line 223 of file VersionNumber.java.
final boolean org.jau.util.VersionNumber.equals | ( | final Object | o | ) |
|
static |
Returns the default pattern
using getVersionNumberPattern(String)
with delimiter "<b>.</b>".
Instance is cached.
Definition at line 84 of file VersionNumber.java.
final int org.jau.util.VersionNumber.getMajor | ( | ) |
Definition at line 267 of file VersionNumber.java.
final int org.jau.util.VersionNumber.getMinor | ( | ) |
Definition at line 271 of file VersionNumber.java.
final int org.jau.util.VersionNumber.getSub | ( | ) |
Definition at line 275 of file VersionNumber.java.
|
static |
Returns the pattern
with Perl regular expression:
"\\D*(\\d+)[^\\"+delim+"\s]*(?:\"+delim+"\D*(\d+)[^\"+delim+"\s]*(?:\"+delim+"\D*(\d+))?)?" </pre> </p> <p> A whitespace within the version number will end the parser. </p> <p> Capture groups represent the major (1), optional minor (2) and optional sub version number (3) component in this order. </p> <p> Each capture group ignores any leading non-digit and uses only contiguous digits, i.e. ignores pending non-digits. </p> @param delim the delimiter, e.g. "."
Definition at line 73 of file VersionNumber.java.
final int org.jau.util.VersionNumber.hashCode | ( | ) |
Definition at line 226 of file VersionNumber.java.
final boolean org.jau.util.VersionNumber.hasMajor | ( | ) |
Returns true
, if the major component is defined explicitly, otherwise false
.
Undefined components has the value 0
.
Definition at line 213 of file VersionNumber.java.
final boolean org.jau.util.VersionNumber.hasMinor | ( | ) |
Returns true
, if the optional minor component is defined explicitly, otherwise false
.
Undefined components has the value 0
.
Definition at line 215 of file VersionNumber.java.
final boolean org.jau.util.VersionNumber.hasSub | ( | ) |
Returns true
, if the optional sub component is defined explicitly, otherwise false
.
Undefined components has the value 0
.
Definition at line 217 of file VersionNumber.java.
final boolean org.jau.util.VersionNumber.isZero | ( | ) |
Returns true
, if all version components are zero, otherwise false
.
Definition at line 208 of file VersionNumber.java.
String org.jau.util.VersionNumber.toString | ( | ) |
Reimplemented in org.jau.util.VersionNumberString.
Definition at line 280 of file VersionNumber.java.
|
staticprotected |
Definition at line 99 of file VersionNumber.java.
|
staticprotected |
Definition at line 100 of file VersionNumber.java.
|
staticprotected |
Definition at line 101 of file VersionNumber.java.
|
protected |
Definition at line 96 of file VersionNumber.java.
|
protected |
Definition at line 96 of file VersionNumber.java.
|
protected |
Definition at line 98 of file VersionNumber.java.
|
protected |
Definition at line 96 of file VersionNumber.java.
|
protected |
Definition at line 96 of file VersionNumber.java.
|
static |
A zero
version instance, w/o any component defined explicitly.
Definition at line 53 of file VersionNumber.java.