edu.isi.pegasus.common.util
Class Version

java.lang.Object
  extended by edu.isi.pegasus.common.util.Version

public class Version
extends Object

This class solely defines the version numbers of PEGASUS. The template file will be substituted by ant during the built process to compile in the built timestamp.

When using the class, the methods for the version number digits will always return an integer. In order to obtain the full version number, including any "release candidate" suffices, please prefer the toString method over combining the separate version integers yourself.

Version:
$Revision: 5069 $ $Id: Version.in 5069 2012-03-01 00:32:01Z rynge $
Author:
Karan Vahi, Jens-S. Vöckler

Field Summary
protected static Version c_instance
          Instance variable keeping track of the Singleton.
static int MAJOR
          This constant defines the major version number.
static int MINOR
          This constant defines the minor version number.
static int PLEVEL
          This constant defines the patch level version.
static String STAMP_FILENAME
          Basename of the build stamp file.
 
Constructor Summary
private Version()
          C'tor: construct an element, which is empty anyway.
 
Method Summary
 String determineBuilt()
          Determines the built as a time stamp.
 String determineInstalled()
          Determines the built and architecture of the installation.
 String determinePlatform()
          Determines the build platform.
static Version instance()
          Accessor to the singleton.
 boolean matches()
          Determines, if the compiled version and the installed version match.
 String toString()
          Returns a string containing the concatenated version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAJOR

public static final int MAJOR
This constant defines the major version number.

See Also:
Constant Field Values

MINOR

public static final int MINOR
This constant defines the minor version number.

See Also:
Constant Field Values

PLEVEL

public static final int PLEVEL
This constant defines the patch level version.

See Also:
Constant Field Values

c_instance

protected static Version c_instance
Instance variable keeping track of the Singleton.


STAMP_FILENAME

public static final String STAMP_FILENAME
Basename of the build stamp file.

See Also:
Constant Field Values
Constructor Detail

Version

private Version()
C'tor: construct an element, which is empty anyway.

Method Detail

instance

public static Version instance()
Accessor to the singleton.


toString

public String toString()
Returns a string containing the concatenated version. Note: This class may also return suffixes beyond the version.

Overrides:
toString in class Object
Returns:
a concatenated string.

determineBuilt

public String determineBuilt()
Determines the built as a time stamp.

Returns:
the formatted time stamp of the built.

determinePlatform

public String determinePlatform()
Determines the build platform.

Returns:
an identifier for the build platform.

determineInstalled

public String determineInstalled()
Determines the built and architecture of the installation. These are usually separated by a linear white-space.

Returns:
the formatted time stamp of the built, if available, and an identifier for the architecture. An string indicating that the build is unknown is returned on failure.

matches

public boolean matches()
Determines, if the compiled version and the installed version match. The match is done by comparing the timestamps and architectures.

Returns:
true, if versions match, false otherwise.


Copyright © 2011 The University of Southern California. All Rights Reserved.