Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.ematgine.utils.ServiceMngt
Class MiscUtilities.VersionCompare  view MiscUtilities.VersionCompare download MiscUtilities.VersionCompare.java

java.lang.Object
  extended byorg.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.


Constructor Summary
MiscUtilities.VersionCompare()
           
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          compare two version strings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiscUtilities.VersionCompare

public MiscUtilities.VersionCompare()
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
compare two version strings

Specified by:
compare in interface MiscUtilities.Compare