weka.core
Class Version

java.lang.Object
  extended byweka.core.Version
All Implemented Interfaces:
java.lang.Comparable

public class Version
extends java.lang.Object
implements java.lang.Comparable

This class contains the version number of the current WEKA release and some methods for comparing another version string. The normal layout of a version string is "MAJOR.MINOR.REVISION", but it can also handle partial version strings, e.g. "3.4".
Should be used e.g. in exports to XML for keeping track, with which version of WEKA the file was produced.

Version:
$Revision: 1.1.2.2 $
Author:
FracPete (fracpete at waikato dot ac dot nz)

Field Summary
static int MAJOR
          the major version
static int MINOR
          the minor version
static int REVISION
          the revision
static java.lang.String VERSION
          the complete version
 
Constructor Summary
Version()
           
 
Method Summary
 int compareTo(java.lang.Object o)
          checks the version of this class against the given version-string
 boolean equals(java.lang.Object o)
          whether the given version string is equal to this version
 boolean isNewer(java.lang.Object o)
          checks whether this version is newer than the one from the given version string
 boolean isOlder(java.lang.Object o)
          checks whether this version is older than the one from the given version string
static void main(java.lang.String[] args)
          only for testing
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAJOR

public static final int MAJOR
the major version

See Also:
Constant Field Values

MINOR

public static final int MINOR
the minor version

See Also:
Constant Field Values

REVISION

public static final int REVISION
the revision

See Also:
Constant Field Values

VERSION

public static final java.lang.String VERSION
the complete version

See Also:
Constant Field Values
Constructor Detail

Version

public Version()
Method Detail

compareTo

public int compareTo(java.lang.Object o)
checks the version of this class against the given version-string

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the version-string to compare with
Returns:
-1 if this version is less, 0 if equal and +1 if greater than the provided version

equals

public boolean equals(java.lang.Object o)
whether the given version string is equal to this version

Parameters:
o - the version-string to compare to
Returns:
TRUE if the version-string is equals to its own

isOlder

public boolean isOlder(java.lang.Object o)
checks whether this version is older than the one from the given version string

Parameters:
o - the version-string to compare with
Returns:
TRUE if this version is older than the given one

isNewer

public boolean isNewer(java.lang.Object o)
checks whether this version is newer than the one from the given version string

Parameters:
o - the version-string to compare with
Returns:
TRUE if this version is newer than the given one

main

public static void main(java.lang.String[] args)
only for testing