org.openmrs.module
Class VersionComparator

java.lang.Object
  extended by org.openmrs.module.VersionComparator
All Implemented Interfaces:
java.util.Comparator<java.lang.String>

public class VersionComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.String>

A comparator which takes version numbers stored as string. It assumes the versions are separated by periods and does not contain letters. This prevents the version number 10 from coming before version number 9.


Constructor Summary
VersionComparator()
           
 
Method Summary
 int compare(java.lang.String o1, java.lang.String o2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

VersionComparator

public VersionComparator()
Method Detail

compare

public int compare(java.lang.String o1,
                   java.lang.String o2)
Specified by:
compare in interface java.util.Comparator<java.lang.String>
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)
Expected behavior:
compare via numeric value not string value

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change