ice.util
Class FullVersionComparator
java.lang.Object
ice.util.MajorMinorVersionComparator
ice.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
|
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 |
FullVersionComparator
public FullVersionComparator()
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 argumento2 - 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