opennlp.tools.util
Class Version

java.lang.Object
  extended by opennlp.tools.util.Version

public class Version
extends Object

The Version class represents the OpenNlp Tools library version.

The version has three parts:


Constructor Summary
Version(int major, int minor, int revision)
          Initializes the current instance with the provided versions.
 
Method Summary
static Version currentVersion()
          Retrieves the current version of the OpenNlp Tools library.
 boolean equals(Object o)
           
 int getMajor()
          Retrieves the major version.
 int getMinor()
          Retrieves the minor version.
 int getRevision()
          Retrieves the revision version.
static Version parse(String version)
          Return a new Version initialized to the value represented by the specified String
 String toString()
          Retrieves the version string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(int major,
               int minor,
               int revision)
Initializes the current instance with the provided versions.

Parameters:
major -
minor -
revision -
Method Detail

getMajor

public int getMajor()
Retrieves the major version.

Returns:
major version

getMinor

public int getMinor()
Retrieves the minor version.

Returns:
minor version

getRevision

public int getRevision()
Retrieves the revision version.

Returns:
revision version

toString

public String toString()
Retrieves the version string. The parse(String) method can create an instance of Version with the returned version value string.

Overrides:
toString in class Object
Returns:
the version value string

equals

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

parse

public static Version parse(String version)
Return a new Version initialized to the value represented by the specified String

Parameters:
version - the string to be parsed
Returns:
the version represented by the string value
Throws:
NumberFormatException - if the string does not contain a valid version

currentVersion

public static Version currentVersion()
Retrieves the current version of the OpenNlp Tools library.

Returns:
the current version


Copyright © 2010. All Rights Reserved.