public class MajorMinorVersion extends AbstractVersion
| Constructor and Description |
|---|
MajorMinorVersion(int major,
int minor)
Creates a version with a major and a minor number and a
null version string. |
MajorMinorVersion(int major,
int minor,
String versionString)
Creates a version with a major number, a minor number and a version
string.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(MajorMinorVersion otherVersion)
Compares two versions by major then minor number.
|
boolean |
equals(Object obj) |
int |
getMajor()
Returns the major version number.
|
int |
getMinor()
Returns the minor version number.
|
int |
hashCode() |
String |
toString() |
getVersionStringpublic MajorMinorVersion(int major,
int minor)
null version string.major - the major version number.minor - the minor version number.public MajorMinorVersion(int major,
int minor,
String versionString)
major - the major version number.minor - the minor version number.versionString - the version string. While the version string should
represent a version with the major and minor numbers specified, that is
not assumed in this implementation.public int getMajor()
public int getMinor()
public int compare(MajorMinorVersion otherVersion)
otherVersion - another MajorMinorVersion.-1 if this version is lower than
otherVersion, 0 if they are the same version,
and 1 if this version is higher than
otherVersion.public int hashCode()
hashCode in class AbstractVersionpublic boolean equals(Object obj)
equals in class AbstractVersionCopyright © 2012–2018 Emory University. All rights reserved.