edu.rice.cs.plt.reflect
Class JavaVersion.FullVersion

java.lang.Object
  extended by edu.rice.cs.plt.reflect.JavaVersion.FullVersion
All Implemented Interfaces:
Serializable, Comparable<JavaVersion.FullVersion>
Enclosing class:
JavaVersion

public static class JavaVersion.FullVersion
extends Object
implements Comparable<JavaVersion.FullVersion>, Serializable

A full Java version, implemented for the sake of comparison between version numbers.

See Also:
The Sun version specification, Serialized Form

Method Summary
 int compareTo(JavaVersion.FullVersion v)
          Compare two versions.
 boolean equals(Object o)
           
 int hashCode()
           
 File location()
           
 int maintenance()
          Get the maintenance associated with this full version
 JavaVersion majorVersion()
          Get the major version associated with this full version
 JavaVersion.FullVersion onlyMajorVersionAndVendor()
          Get a full version with the maintenance, update and release type zeroed out.
 edu.rice.cs.plt.reflect.JavaVersion.ReleaseType release()
          Get the update associated with this full version
 boolean supports(JavaVersion v)
          Convenience method calling majorVersion().supports(v)
 String toString()
           
 int update()
          Get the update associated with this full version
 JavaVersion.VendorType vendor()
          Get the vendor associated with this full version
 String versionString()
          Produce a string representing version number
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

majorVersion

public JavaVersion majorVersion()
Get the major version associated with this full version


onlyMajorVersionAndVendor

public JavaVersion.FullVersion onlyMajorVersionAndVendor()
Get a full version with the maintenance, update and release type zeroed out.


maintenance

public int maintenance()
Get the maintenance associated with this full version


update

public int update()
Get the update associated with this full version


release

public edu.rice.cs.plt.reflect.JavaVersion.ReleaseType release()
Get the update associated with this full version


vendor

public JavaVersion.VendorType vendor()
Get the vendor associated with this full version


location

public File location()

supports

public boolean supports(JavaVersion v)
Convenience method calling majorVersion().supports(v)


compareTo

public int compareTo(JavaVersion.FullVersion v)
Compare two versions. Major, maintenance, and update numbers are ordered sequentially. When comparing two versions that are otherwise equivalent, early access releases precede betas, followed by release candidates and stable releases. Within the release types, Unrecognized < OpenJDK < Apple < Oracle. Versions with unknown vendor are only equal if their locations are also equal.

Specified by:
compareTo in interface Comparable<JavaVersion.FullVersion>

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

versionString

public String versionString()
Produce a string representing version number


toString

public String toString()
Overrides:
toString in class Object