|
JPF 1.5.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.java.plugin.registry.Version
public final class Version
This class represents a plug-in version identifier.
Field Summary | |
---|---|
static char |
SEPARATOR
Version identifier parts separator. |
Constructor Summary | |
---|---|
Version(int aMajor,
int aMinor,
int aBuild,
java.lang.String aName)
Creates version identifier object from given parts. |
Method Summary | |
---|---|
int |
compareTo(Version obj)
|
boolean |
equals(java.lang.Object obj)
|
int |
getBuild()
|
int |
getMajor()
|
int |
getMinor()
|
java.lang.String |
getName()
|
int |
hashCode()
|
boolean |
isCompatibleWith(Version other)
Compares two version identifiers for compatibility. |
boolean |
isEquivalentTo(Version other)
Compares two version identifiers for equivalency. |
boolean |
isGreaterOrEqualTo(Version other)
Compares two version identifiers to see if this one is greater than or equal to the argument. |
boolean |
isGreaterThan(Version other)
Compares two version identifiers for order using multi-decimal comparison. |
static Version |
parse(java.lang.String str)
Parses given string as version identifier. |
java.lang.String |
toString()
Returns the string representation of this version identifier. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char SEPARATOR
Constructor Detail |
---|
public Version(int aMajor, int aMinor, int aBuild, java.lang.String aName)
aMajor
- major version numberaMinor
- minor version numberaBuild
- build numberaName
- build name, null
value becomes empty stringMethod Detail |
---|
public static Version parse(java.lang.String str)
str
- version identifier as string
public int getBuild()
public int getMajor()
public int getMinor()
public java.lang.String getName()
public boolean isGreaterOrEqualTo(Version other)
A version identifier is considered to be greater than or equal if its major component is greater than the argument major component, or the major components are equal and its minor component is greater than the argument minor component, or the major and minor components are equal and its build component is greater than the argument build component, or all components are equal.
other
- the other version identifier
true
if this version identifier
is compatible with the given version identifier, and
false
otherwisepublic boolean isCompatibleWith(Version other)
A version identifier is considered to be compatible if its major component equals to the argument major component, and its minor component is greater than or equal to the argument minor component. If the minor components are equal, than the build component of the version identifier must be greater than or equal to the build component of the argument identifier.
other
- the other version identifier
true
if this version identifier
is compatible with the given version identifier, and
false
otherwisepublic boolean isEquivalentTo(Version other)
Two version identifiers are considered to be equivalent if their major and minor components equal and are at least at the same build level as the argument.
other
- the other version identifier
true
if this version identifier
is equivalent to the given version identifier, and
false
otherwisepublic boolean isGreaterThan(Version other)
other
- the other version identifier
true
if this version identifier
is greater than the given version identifier, and
false
otherwisepublic int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.lang.String toString()
version.equals(new Version(version.toString()))
.
toString
in class java.lang.Object
public int compareTo(Version obj)
compareTo
in interface java.lang.Comparable<Version>
obj
- version to compare this instance with
Comparable.compareTo(java.lang.Object)
|
JPF 1.5.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |