com.sun.electric.database.text
Class Version

java.lang.Object
  extended by com.sun.electric.database.text.Version
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Version>

public class Version
extends java.lang.Object
implements java.lang.Comparable<Version>, java.io.Serializable

A Version is a text-parsing object for Electric's version number. Electric's current version has the form:

Major.Minor[Details]

where Major is the major release number, Minor is the minor release number within the major release, and Details are sub-release values which can be letters or numbers.

If Details are omitted, then this is a full release of Electric. If Details are present, then this is an interim release. The Details can take two forms: letters (for prereleases) or numbers with a dot in front (for postrelease updates).

For example: "8.00" major=8, minor=0, detail=999 (a Release) "8.01a" major=8, minor=1, detail=1 (a Prerelease) "8.01z" major=8, minor=1, detail=26 (a Prerelease) "8.01aa" major=8, minor=1, detail=27 (a Prerelease) "8.01az" major=8, minor=1, detail=52 (a Prerelease) "8.01ba" major=8, minor=1, detail=53 (a Prerelease) "8.01" major=8, minor=1, detail=999 (a Release) "8.01.1" major=8, minor=1, detail=1001 (a PostRelease update)

See Also:
Serialized Form

Method Summary
 int compareTo(Version v)
          Compares two Version objects numerically.
 boolean equals(java.lang.Object obj)
          Compares this Version object to the specified object.
static java.lang.String getApplicationInformation()
          Method to return official name of Electric
static java.lang.String getAuthorInformation()
          Method to return author information
static java.lang.String getBuildDate()
          Method to return build date of main jar file
static java.lang.String getCopyrightInformation()
          Method to return copyright information
 int getDetail()
          Method to return the details part of a parsed Version number.
 int getMajor()
          Method to return the major part of a parsed Version number.
 int getMinor()
          Method to return the minor part of a parsed Version number.
static Version getVersion()
          Method to return the current Electric version.
static java.lang.String getVersionInformation()
          Method to return version and compilation date if available
static java.lang.String getWarrantyInformation()
          Method to return a short description of warranty
 int hashCode()
          Returns a hash code for this Version.
static Version parseVersion(java.lang.String version)
          Method to parse the specified Version number and return a Version object.
 java.lang.String toString()
          Returns a String object representing this Version.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getAuthorInformation

public static java.lang.String getAuthorInformation()
Method to return author information

Returns:
Steven M. Rubin

getApplicationInformation

public static java.lang.String getApplicationInformation()
Method to return official name of Electric

Returns:
the official name

getCopyrightInformation

public static java.lang.String getCopyrightInformation()
Method to return copyright information

Returns:
Sun Microsystems and Static Free Software

getWarrantyInformation

public static java.lang.String getWarrantyInformation()
Method to return a short description of warranty

Returns:
short description of warranty

getVersionInformation

public static java.lang.String getVersionInformation()
Method to return version and compilation date if available

Returns:
string containing version number and date of jar file

getVersion

public static Version getVersion()
Method to return the current Electric version.

Returns:
the current Electric version.

getBuildDate

public static java.lang.String getBuildDate()
Method to return build date of main jar file

Returns:
string containing the date in short format

getMajor

public int getMajor()
Method to return the major part of a parsed Version number.

Returns:
the major part of a parsed Version number.

getMinor

public int getMinor()
Method to return the minor part of a parsed Version number.

Returns:
the minor part of a parsed Version number.

getDetail

public int getDetail()
Method to return the details part of a parsed Version number.

Returns:
the details part of a parsed Version number.

hashCode

public int hashCode()
Returns a hash code for this Version.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this Version.

equals

public boolean equals(java.lang.Object obj)
Compares this Version object to the specified object. The result is true if and only if the argument is not null and is an Version object that contains the same major, minor and details as this Version.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare with.
Returns:
true if the objects are the same; false otherwise.

compareTo

public int compareTo(Version v)
Compares two Version objects numerically.

Specified by:
compareTo in interface java.lang.Comparable<Version>
Parameters:
v - the object to be compared.
Returns:
the result of comparison.

toString

public java.lang.String toString()
Returns a String object representing this Version.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this Version

parseVersion

public static Version parseVersion(java.lang.String version)
Method to parse the specified Version number and return a Version object.

Parameters:
version - the version of Electric.
Returns:
a Version object with the fields parsed.