gate.util
Class VersionComparator
java.lang.Object
gate.util.VersionComparator
- All Implemented Interfaces:
- Comparator<String>
public class VersionComparator
- extends Object
- implements Comparator<String>
A comparator that can be used for comparing GATE version strings. This
includes comparing SNAPSHOT versions as well as releases. This is needed to
be able to determine if a CREOLE plugin is compatible with a specific GATE
version.
- Author:
- Mark A. Greenwood
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VersionComparator
public VersionComparator()
compare
public int compare(String v1,
String v2)
- Specified by:
compare
in interface Comparator<String>
compareVersions
public static int compareVersions(String v1,
String v2)
isGATENewEnough
public static boolean isGATENewEnough(String version)
- Returns true if the specified version is the same or newer than the version
of GATE being used.
- Parameters:
version
- the version number to check
- Returns:
- true if the specified version is the same or newer than the version
of GATE being used, false otherwise
isGATEOldEnough
public static boolean isGATEOldEnough(String version)
- Returns true if the specified version is the same or older than the version
of GATE being used.
- Parameters:
version
- the version number to check
- Returns:
- true if the specified version is the same or older than the version
of GATE being used, false otherwise
isCompatible
public static boolean isCompatible(String min,
String max)
- Checks to see if the version of GATE falls between the two specified
versions (this is an inclusive check).
- Parameters:
min
- the minimum compatible GATE versionmax
- the maximum compatible GATE version
- Returns:
- if the version of GATE falls between the two specified versions
(this is an inclusive check), false otherwise