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.
| Modifier and Type | Field and Description |
|---|---|
| private static volatile Pattern | |
| protected static final short | |
| protected static final short | |
| protected static final short | |
| protected final int | |
| protected final int | |
| protected final short | |
| protected final int | |
| protected final int | |
| public static final VersionNumber | zeroVersion
A |
| Access | Constructor and Description |
|---|---|
| protected | VersionNumber(final int majorRev, final int minorRev, final int subMinorRev, final int _strEnd, final short _state)
|
| public | VersionNumber(final int majorRev, final int minorRev, final int subMinorRev)
Explicit version number instantiation, with all components defined explicitly. |
| public | VersionNumber(final String
should be given as [MAJOR[.MINOR[.SUB]]] versionString)String derived version number instantiation. |
| public | VersionNumber(final String
should be given as [MAJOR[.MINOR[.SUB]]] versionString, final String the delimiter, e.g. "." delim)String derived version number instantiation. |
| public | VersionNumber(final String
should be given as [MAJOR[.MINOR[.SUB]]] versionString, final Pattern the versionPattern)pattern parser, must be compatible w/ getVersionNumberPattern(String)String derived version number instantiation. |
| Modifier and Type | Method and Description |
|---|---|
| public final int | compareTo(final Object
the object to be compared. o)Implements java. |
| public final int | compareTo(final VersionNumber
the object to be compared. vo)Implements java. |
| public final int | endOfStringMatch()
If constructed with |
| public final boolean | equals(final Object
the reference object with which to compare. o)Overrides java. |
| public static Pattern | getDefaultVersionNumberPattern()
Returns the default |
| public final int | |
| public final int | |
| public final int | |
| public static Pattern | getVersionNumberPattern(final String
the delimiter, e.g. "." delim)Returns the "\\D*(\\d+)[^\\"+delim+"\\s]*(?:\\"+delim+"\\D*(\\d+)[^\\"+delim+"\\s]*(?:\\"+delim+"\\D*(\\d+))?)?" |
| public final int | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public String |
| defPattern | back to summary |
|---|---|
| private static volatile Pattern defPattern | |
| HAS_MAJOR | back to summary |
|---|---|
| protected static final short HAS_MAJOR | |
| HAS_MINOR | back to summary |
|---|---|
| protected static final short HAS_MINOR | |
| HAS_SUB | back to summary |
|---|---|
| protected static final short HAS_SUB | |
| major | back to summary |
|---|---|
| protected final int major | |
| minor | back to summary |
|---|---|
| protected final int minor | |
| state | back to summary |
|---|---|
| protected final short state | |
| strEnd | back to summary |
|---|---|
| protected final int strEnd | |
| sub | back to summary |
|---|---|
| protected final int sub | |
| zeroVersion | back to summary |
|---|---|
| public static final VersionNumber zeroVersion A
| |
| VersionNumber | back to summary |
|---|---|
| protected VersionNumber(final int majorRev, final int minorRev, final int subMinorRev, final int _strEnd, final short _state) | |
| VersionNumber | back to summary |
|---|---|
| public VersionNumber(final int majorRev, final int minorRev, final int subMinorRev) Explicit version number instantiation, with all components defined explicitly.
| |
| VersionNumber | back to summary |
|---|---|
| public VersionNumber(final String versionString) String derived version number instantiation.
Utilizing the default
You can query whether a component has been defined explicitly by the given
| |
| VersionNumber | back to summary |
|---|---|
| public VersionNumber(final String versionString, final String delim) String derived version number instantiation.
Utilizing
You can query whether a component has been defined explicitly by the given
| |
| VersionNumber | back to summary |
|---|---|
| public VersionNumber(final String versionString, final Pattern versionPattern) String derived version number instantiation.
You can query whether a component has been defined explicitly by the given
| |
| compareTo | back to summary |
|---|---|
| public final int compareTo(final Object o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |
| compareTo | back to summary |
|---|---|
| public final int compareTo(final VersionNumber vo) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| endOfStringMatch | back to summary |
|---|---|
| public final int endOfStringMatch() If constructed with | |
| equals | back to summary |
|---|---|
| public final boolean equals(final Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getDefaultVersionNumberPattern | back to summary |
|---|---|
| public static Pattern getDefaultVersionNumberPattern() Returns the default Instance is cached. | |
| getMajor | back to summary |
|---|---|
| public final int getMajor() | |
| getMinor | back to summary |
|---|---|
| public final int getMinor() | |
| getSub | back to summary |
|---|---|
| public final int getSub() | |
| getVersionNumberPattern | back to summary |
|---|---|
| public static Pattern getVersionNumberPattern(final String delim) Returns the "\\D*(\\d+)[^\\"+delim+"\\s]*(?:\\"+delim+"\\D*(\\d+)[^\\"+delim+"\\s]*(?:\\"+delim+"\\D*(\\d+))?)?" A whitespace within the version number will end the parser. Capture groups represent the major (1), optional minor (2) and optional sub version number (3) component in this order. Each capture group ignores any leading non-digit and uses only contiguous digits, i.e. ignores pending non-digits.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasMajor | back to summary |
|---|---|
| public final boolean hasMajor() Returns | |
| hasMinor | back to summary |
|---|---|
| public final boolean hasMinor() Returns | |
| hasSub | back to summary |
|---|---|
| public final boolean hasSub() Returns | |
| isZero | back to summary |
|---|---|
| public final boolean isZero() Returns | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |