Package weka.core
Class Version
- java.lang.Object
-
- weka.core.Version
-
- All Implemented Interfaces:
java.lang.Comparable
,RevisionHandler
public class Version extends java.lang.Object implements java.lang.Comparable, 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: 1.8 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAJOR
the major versionstatic int
MINOR
the minor versionstatic int
REVISION
the revisionstatic boolean
SNAPSHOT
True if snapshotstatic java.lang.String
VERSION
the complete versionstatic java.lang.String
VERSION_FILE
the version file
-
Constructor Summary
Constructors Constructor Description Version()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
checks the version of this class against the given version-stringboolean
equals(java.lang.Object o)
whether the given version string is equal to this versionjava.lang.String
getRevision()
Returns the revision string.boolean
isNewer(java.lang.Object o)
checks whether this version is newer than the one from the given version stringboolean
isOlder(java.lang.Object o)
checks whether this version is older than the one from the given version stringstatic void
main(java.lang.String[] args)
only for testingjava.lang.String
toString()
returns the current version as string
-
-
-
Field Detail
-
VERSION_FILE
public static final java.lang.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
-
SNAPSHOT
public static boolean SNAPSHOT
True if snapshot
-
VERSION
public static java.lang.String VERSION
the complete 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 interfacejava.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- Overrides:
equals
in classjava.lang.Object
- 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
-
toString
public java.lang.String toString()
returns the current version as string- Overrides:
toString
in classjava.lang.Object
- Returns:
- the current version
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
main
public static void main(java.lang.String[] args)
only for testing- Parameters:
args
- the commandline arguments - ignored
-
-