Package weka.core

# Class Version

java.lang.Object
weka.core.Version

All Implemented Interfaces:
  `Comparable<String>`, `RevisionHandler`

public class Version extends Object implements Comparable<String>, RevisionHandler
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: 10203 $
Author:
  FracPete (fracpete at waikato dot ac dot nz)

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static int`
  `MAJOR`
  the major version
  `static int`
  `MINOR`
  the minor version
  `static int`
  `POINT`
  point revision
  `static int`
  `REVISION`
  the revision
  `static boolean`
  `SNAPSHOT`
  True if snapshot
  `static String`
  `VERSION`
  the complete version
  `static final String`
  `VERSION_FILE`
  the version file

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Version()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(String o)`
  checks the version of this class against the given version-string
  `boolean`
  `equals(Object o)`
  whether the given version string is equal to this version
  `String`
  `getRevision()`
  Returns the revision string.
  `boolean`
  `isNewer(String o)`
  checks whether this version is newer than the one from the given version string
  `boolean`
  `isOlder(String o)`
  checks whether this version is older than the one from the given version string
  `static void`
  `main(String[] args)`
  only for testing
  `String`
  `toString()`
  returns the current version as string

  ### Methods inherited from class java.lang.Object

  `getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### VERSION_FILE

    public static final String VERSION_FILE
    the version file
    See Also:
      - Constant Field Values

  - ### MAJOR

    public static int MAJOR
    the major version

  - ### MINOR

    public static int MINOR
    the minor version

  - ### REVISION

    public static int REVISION
    the revision

  - ### POINT

    public static int POINT
    point revision

  - ### SNAPSHOT

    public static boolean SNAPSHOT
    True if snapshot

  - ### VERSION

    public static String VERSION
    the complete version

- ## Constructor Details

  - ### Version

    public Version()

- ## Method Details

  - ### compareTo

    public int compareTo(String o)
    checks the version of this class against the given version-string
    Specified by:
      `compareTo` in interface `Comparable<String>`
    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(Object o)
    whether the given version string is equal to this version
    Overrides:
      `equals` in class `Object`
    Parameters:
      `o` - the version-string to compare to
    Returns:
      TRUE if the version-string is equals to its own

  - ### isOlder

    public boolean isOlder(String 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(String 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

  - ### toString

    public String toString()
    returns the current version as string
    Overrides:
      `toString` in class `Object`
    Returns:
      the current version

  - ### getRevision

    public String getRevision()
    Returns the revision string.
    Specified by:
      `getRevision` in interface `RevisionHandler`
    Returns:
      the revision

  - ### main

    public static void main(String[] args)
    only for testing
    Parameters:
      `args` - the commandline arguments - ignored