ice.util
Class FullVersionComparator

java.lang.Object
  extended byice.util.MajorMinorVersionComparator
      extended byice.util.FullVersionComparator
All Implemented Interfaces:
Comparator

public class FullVersionComparator
extends MajorMinorVersionComparator

A utility class that performs a Comparison on the full length of the version specification on the underlying AbstractVersion class


Field Summary
 
Fields inherited from class ice.util.MajorMinorVersionComparator
comparisonLength
 
Constructor Summary
FullVersionComparator()
           
 
Method Summary
 int compare(Object o1, Object o2)
          Compare two Version objects, using the Dynamic comparison rules for Java Versions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ice.util.Comparator
equals
 

Constructor Detail

FullVersionComparator

public FullVersionComparator()
Method Detail

compare

public int compare(Object o1,
                   Object o2)
Compare two Version objects, using the Dynamic comparison rules for Java Versions. This class compares the Full version specificiation
 FullVersionComparator fvc = new FullVersionComparator();
 Version v1 = new Version("1.2");
 Version v2 = new Version("1.2.4");
 if (fvc.compare( v1, v2) != 0 ) {
     // versions not equal
 }
 

Specified by:
compare in interface Comparator
Overrides:
compare in class MajorMinorVersionComparator
Parameters:
o1 - The first argument
o2 - The second argument
Returns:
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
Throws:
ClassCastException - if the passed objects are not subclasses of AbstractVersion