jas2.util.pluginmanager
Class VersionNumberCompare
- java.lang.Object
-
- jas2.util.pluginmanager.VersionNumberCompare
-
public class VersionNumberCompare extends java.lang.ObjectThis class is used to compare version numbers. The only method in this class converts both the currentversion and the latest version (method arguments) strings into string chunks (i.e. if string = 2.0.4, then ints are 2,0,4). The string chunks are then converted to ints and compared one at a time. If a latest version chunk is > than a current version chunk an update is available and UPDATEVERSION is returned. If all chunks are equal then NOUPDATEVERSION is available. If a latest chunk is < current chunk or Strings can't be converted to ints an Exception is thrown.
-
-
Field Summary
Fields Modifier and Type Field and Description static intNOUPDATEVERSIONstatic intUPDATEVERSIONstatic intVERSIONCHECKERROR
-
Constructor Summary
Constructors Constructor and Description VersionNumberCompare()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcompareVersions(java.lang.String currentversion, java.lang.String latestversion, boolean throwexception)This method converts both the currentversion and the latest version (method arguments) strings into string chunks (i.e.
-
-
-
Field Detail
-
VERSIONCHECKERROR
public static final int VERSIONCHECKERROR
- See Also:
- Constant Field Values
-
UPDATEVERSION
public static final int UPDATEVERSION
- See Also:
- Constant Field Values
-
NOUPDATEVERSION
public static final int NOUPDATEVERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
compareVersions
public int compareVersions(java.lang.String currentversion, java.lang.String latestversion, boolean throwexception) throws jas2.util.pluginmanager.VersionNumberCompare.VersionCompareExceptionThis method converts both the currentversion and the latest version (method arguments) strings into string chunks (i.e. if string = 2.0.4, then ints are 2,0,4). The string chunks are then converted to ints and compared one at a time. If a latest version chunk is > than a current version chunk an update is available and UPDATEVERSION is returned. If all chunks are equal then NOUPDATEVERSION is available. The boolean throw exception controls whether the VersionNumberCompare exception will be thrown when a latestversion chunk is less than a current version chunk.- Throws:
jas2.util.pluginmanager.VersionNumberCompare.VersionCompareException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG