org.codehaus.mojo.versions.ordering
Class MavenVersionComparator

java.lang.Object
  extended by org.codehaus.mojo.versions.ordering.MavenVersionComparator
All Implemented Interfaces:
Comparator

public class MavenVersionComparator
extends Object
implements Comparator

A comparator which uses Maven's version rules, i.e. 1.3.34 > 1.3.9 but 1.3.4.3.2.34 < 1.3.4.3.2.9.

Since:
1.0-alpha-3
Author:
Stephen Connolly

Constructor Summary
MavenVersionComparator()
           
 
Method Summary
 int compare(Object o1, Object o2)
          
 boolean equals(Object obj)
          Returns true if this object is the same type of comparator as the parameter.
 int hashCode()
          Returns a hash code value for the comparator class.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenVersionComparator

public MavenVersionComparator()
Method Detail

compare

public int compare(Object o1,
                   Object o2)

Specified by:
compare in interface Comparator

hashCode

public int hashCode()
Returns a hash code value for the comparator class.

Overrides:
hashCode in class Object
Returns:
the hash code.

equals

public boolean equals(Object obj)
Returns true if this object is the same type of comparator as the parameter.

Specified by:
equals in interface Comparator
Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
hashCode(), Hashtable


Copyright © 2008-2009 Codehaus. All Rights Reserved.