|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--gecco.util.VersionNumber
A utility class for holding, parsing and comparing version numbers.
| Constructor Summary | |
VersionNumber()
Constructs an empty version number. |
|
VersionNumber(int major)
Constructs a version number with only a major number, such as "3". |
|
VersionNumber(int major,
int minor)
Constructs a version number with a major and a minor number, such as "3.1". |
|
VersionNumber(int major,
int minor1,
int minor2)
Constructs a version number with a major and two minor numbers, such as "3.1.41". |
|
VersionNumber(String version)
Constructs a version number from a String, such as "3.14.15". |
|
| Method Summary | |
boolean |
atLeast(VersionNumber other)
Determines if this VersionNumber is greater than or equal to the other VersionNumber. |
int |
compareTo(Object o)
Compares this object with another object. |
int |
compareTo(VersionNumber other)
Compares this VersionNumber with another VersionNumber. |
boolean |
equals(Object o)
Determines whether this object is equal to another object. |
boolean |
greaterThan(VersionNumber other)
Determines if this VersionNumber is greater than the other VersionNumber. |
int |
hashCode()
Computes the hash code of this VersionNumber. |
boolean |
lessThan(VersionNumber other)
Determines if this VersionNumber is less than the other VersionNumber. |
String |
toString()
Returns the String representation of this VersionNumber. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public VersionNumber()
public VersionNumber(int major)
major - The major version number.
public VersionNumber(int major,
int minor)
major - The major version number.minor - The minor version number.
public VersionNumber(int major,
int minor1,
int minor2)
major - The major version number.minor1 - The most significant minor version number.minor2 - The least significant minor version number.
public VersionNumber(String version)
throws NumberFormatException
version - The String to be parsed.
NumberFormatException - If the parts of the String
separated by periods could not be parsed as integers.| Method Detail |
public int compareTo(Object o)
compareTo in interface Comparableo - The other object.
public int compareTo(VersionNumber other)
other - The other VersionNumber.
public boolean lessThan(VersionNumber other)
other - The other VersionNumber.
public boolean greaterThan(VersionNumber other)
other - The other VersionNumber.
public boolean atLeast(VersionNumber other)
other - The other VersionNumber.
public boolean equals(Object o)
equals in class Objecto - The other object.
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||