uk.ac.starlink.topcat
Class Version

java.lang.Object
  extended by uk.ac.starlink.topcat.Version
All Implemented Interfaces:
Comparable

public class Version
extends Object
implements Comparable

Comparable class which can compare version strings. Versions are of the form A.B[-C[x]], where the square bracketed parts are optional. A, B and C must be integers if present. x may be freeform.

For comparison, only A, B and C parts are considered. If C is missing, it is considered equal to zero. For equality, the original version string is used.

Note: this class has a natural ordering that is inconsistent with equals.

Since:
20 Dec 2010
Author:
Mark Taylor

Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.