Package megamek
Class Version
java.lang.Object
megamek.Version
- All Implemented Interfaces:
Serializable
,Comparable<Version>
This is used for versioning, and to track the current Version the suite is
running at.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
void
fillFromText
(String text) int
getMajor()
int
getMinor()
int
int
hashCode()
boolean
boolean
boolean
boolean
boolean
isHigherThan
(String other) Use this method to determine if this version is higher than the version passedboolean
isHigherThan
(Version other) Use this method to determine if the version passed is less than this Version object.boolean
isLowerThan
(String other) Use this method to determine if this version is lower than the version passedboolean
isLowerThan
(Version other) Use this method to determine if this version is lower than the version passedboolean
void
setMajor
(int major) void
setMinor
(int minor) void
setRelease
(int release) void
setSnapshot
(boolean snapshot) toString()
void
writeToXML
(PrintWriter pw, int indent)
-
Constructor Details
-
Version
public Version()This Constructor is not to be used outside of unit testing -
Version
-
Version
public Version(String release, String major, String minor, String snapshot) throws NumberFormatException - Throws:
NumberFormatException
-
-
Method Details
-
getRelease
public int getRelease() -
setRelease
public void setRelease(int release) -
getMajor
public int getMajor() -
setMajor
public void setMajor(int major) -
getMinor
public int getMinor() -
setMinor
public void setMinor(int minor) -
isSnapshot
public boolean isSnapshot() -
setSnapshot
public void setSnapshot(boolean snapshot) -
isHigherThan
Use this method to determine if this version is higher than the version passed- Parameters:
other
- The version we want to see if it is lower than this version- Returns:
- true if this is higher than checkVersion
-
isHigherThan
Use this method to determine if the version passed is less than this Version object.- Parameters:
other
- The version we want to see if is less than this version- Returns:
- true if checkVersion is less than this Version object
-
isLowerThan
Use this method to determine if this version is lower than the version passed- Parameters:
other
- The version we want to see if it is higher than this version.- Returns:
- true if this is lower than checkVersion
-
isLowerThan
Use this method to determine if this version is lower than the version passed- Parameters:
other
- The version we want to see if it is higher than this version.- Returns:
- true if this is lower than checkVersion
-
isBetween
- Parameters:
lower
- the lower Version bound (exclusive)upper
- the upper Version bound (exclusive)- Returns:
- true if the version is between lower and upper versions, both exclusive
-
isBetween
- Parameters:
lower
- the lower Version bound (exclusive)upper
- the upper Version bound (exclusive)- Returns:
- true is the version is between lower and upper versions, both exclusive
-
is
- Parameters:
other
- The version we want to see if it is the same as this version.- Returns:
- true if this is same version as the other
-
is
- Parameters:
other
- The version we want to see if it is the same as this version.- Returns:
- true if this is same version as the other
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
equals
-
hashCode
public int hashCode() -
writeToXML
-
fillFromText
-
toString
-