ice.util
Class MajorMinorVersionComparator

java.lang.Object
  extended byice.util.MajorMinorVersionComparator
All Implemented Interfaces:
Comparator
Direct Known Subclasses:
FullVersionComparator, MajorMinorReleaseVersionComparator

public class MajorMinorVersionComparator
extends Object
implements Comparator

This Comparator instance performs a comparison between the version values defined in the AbstractVersion Base class, comparing the first two parts of the version specification.


Field Summary
protected  int comparisonLength
          The default comparison length for this base class defaults to two.
 
Constructor Summary
MajorMinorVersionComparator()
           
 
Method Summary
 int compare(Object o1, Object o2)
          Compare two Version instances, comparing only the first two Version specification parts, which corresponds to the Major and minor versions in most version specifications.
 
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
 

Field Detail

comparisonLength

protected int comparisonLength
The default comparison length for this base class defaults to two.

Constructor Detail

MajorMinorVersionComparator

public MajorMinorVersionComparator()
Method Detail

compare

public int compare(Object o1,
                   Object o2)
Compare two Version instances, comparing only the first two Version specification parts, which corresponds to the Major and minor versions in most version specifications. Subclasses of this comparator can alter the length of the comparison by setting comparisonLength before calling this method.

Specified by:
compare in interface Comparator
Parameters:
o1 - The first argument
o2 - The second argument
Returns:
true if o1 is at least equal to or greater than o2, through the MAJOR_PART + MINOR_PART of the version specification