java.lang.Object
org.ematgine.utils.ServiceMngt.MiscUtilities.VersionCompare
- All Implemented Interfaces:
- MiscUtilities.Compare
- Enclosing class:
- MiscUtilities
- public static class MiscUtilities.VersionCompare
- extends java.lang.Object
- implements MiscUtilities.Compare
Compares two version strings formatted like 'xxx.xx.xxx'.
The version string are tokenized at '.' and the substrings
of both strings are compared with one after another.
For each substring at first they are compared as Integers
and if that fails, as Strings. The comparison ends with
the first difference.
Note, that "1.2.0" < "1.2.0pre1", because "0" < "0pre1".
Therefore you should avoid mixing numbers and text.
Case is not ignored.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MiscUtilities.VersionCompare
public MiscUtilities.VersionCompare()
compare
public int compare(java.lang.Object obj1,
java.lang.Object obj2)
- compare two version strings
- Specified by:
compare in interface MiscUtilities.Compare