com.alee.utils.system
Class JavaVersion

java.lang.Object
  extended by com.alee.utils.system.JavaVersion

public class JavaVersion
extends java.lang.Object

Java version information class.

Author:
Mikle Garin

Constructor Summary
JavaVersion(double major, int update)
          Constructs JavaVersion with specified major version and update number.
JavaVersion(double major, int minor, int update)
          Constructs JavaVersion with specified major version, minor version and update number.
JavaVersion(java.lang.String version)
          Constructs JavaVersion using the specified java version.
 
Method Summary
 void applyJavaVersion(java.lang.String version)
          Applies specified java version.
 int compareVersion(double major, int minor, int update)
          Returns a negative integer, zero, or a positive integer if this java version is less than, equal to, or greater than the other one.
 double getMajorVersion()
          Returns major java version.
 int getMinorVersion()
          Returns minor java version.
 java.lang.String getPatch()
          Returns java patch.
 int getUpdateNumber()
          Returns java update number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaVersion

public JavaVersion(double major,
                   int update)
Constructs JavaVersion with specified major version and update number.

Parameters:
major - major java version
update - java update number

JavaVersion

public JavaVersion(double major,
                   int minor,
                   int update)
Constructs JavaVersion with specified major version, minor version and update number.

Parameters:
major - major java version
minor - minor java version
update - java update number

JavaVersion

public JavaVersion(java.lang.String version)
Constructs JavaVersion using the specified java version.

Parameters:
version - java version string
Method Detail

applyJavaVersion

public void applyJavaVersion(java.lang.String version)
Applies specified java version.

Parameters:
version - java version

compareVersion

public int compareVersion(double major,
                          int minor,
                          int update)
Returns a negative integer, zero, or a positive integer if this java version is less than, equal to, or greater than the other one.

Parameters:
major - major java version
minor - minor java version
update - java update number
Returns:
a negative integer, zero, or a positive integer if this java version is less than, equal to, or greater than the other one

getMajorVersion

public double getMajorVersion()
Returns major java version.

Returns:
major java version

getMinorVersion

public int getMinorVersion()
Returns minor java version.

Returns:
minor java version

getUpdateNumber

public int getUpdateNumber()
Returns java update number.

Returns:
java update number

getPatch

public java.lang.String getPatch()
Returns java patch.

Returns:
java patch