com.mucommander.runtime
Class JavaVersion

java.lang.Object
  extended by com.mucommander.runtime.RuntimeProperty
      extended by com.mucommander.runtime.ComparableRuntimeProperty
          extended by com.mucommander.runtime.JavaVersion
All Implemented Interfaces:
JavaVersions, java.lang.Comparable

public class JavaVersion
extends ComparableRuntimeProperty
implements JavaVersions

This class represents a major version of Java, like Java 1.5 for instance. The current runtime instance is determined using the value of the java.version system property. Being a ComparableRuntimeProperty, versions of Java are ordered and can be compared against each other.

Author:
Maxence Bernard
See Also:
JavaVersions

Field Summary
 
Fields inherited from class com.mucommander.runtime.ComparableRuntimeProperty
discriminator
 
Fields inherited from class com.mucommander.runtime.RuntimeProperty
stringRepresentation
 
Fields inherited from interface com.mucommander.runtime.JavaVersions
JAVA_1_0, JAVA_1_1, JAVA_1_2, JAVA_1_3, JAVA_1_4, JAVA_1_5, JAVA_1_6, JAVA_1_7
 
Constructor Summary
protected JavaVersion(java.lang.String stringRepresentation, int intValue)
           
 
Method Summary
static JavaVersion getCurrent()
          Returns the Java version of the current runtime environment.
protected  RuntimeProperty getCurrentValue()
          Returns the current runtime environment's value of this runtime property.
static java.lang.String getRawSystemProperty()
          Returns the value of the system property which serves to detect the Java version at runtime.
static void init()
          Determines the current value by parsing the corresponding system property.
 
Methods inherited from class com.mucommander.runtime.ComparableRuntimeProperty
compareTo, isCurrentHigher, isCurrentLower, isCurrentOrHigher, isCurrentOrLower
 
Methods inherited from class com.mucommander.runtime.RuntimeProperty
isCurrent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaVersion

protected JavaVersion(java.lang.String stringRepresentation,
                      int intValue)
Method Detail

init

public static void init()
Determines the current value by parsing the corresponding system property. This method is called automatically by this class the first time the current value is accessed. However, this method has been made public to allow to force the initialization if it needs to happen at a predictable time.


getCurrent

public static JavaVersion getCurrent()
Returns the Java version of the current runtime environment.

Returns:
the Java version of the current runtime environment

getRawSystemProperty

public static java.lang.String getRawSystemProperty()
Returns the value of the system property which serves to detect the Java version at runtime.

Returns:
the value of the system property which serves to detect the Java version at runtime.

getCurrentValue

protected RuntimeProperty getCurrentValue()
Description copied from class: RuntimeProperty
Returns the current runtime environment's value of this runtime property.

Specified by:
getCurrentValue in class RuntimeProperty
Returns:
the current runtime environment's value of this runtime property


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard