ca.sqlpower.architect
Class ArchitectVersion

java.lang.Object
  extended by ca.sqlpower.architect.ArchitectVersion
All Implemented Interfaces:
java.lang.Comparable<ArchitectVersion>

public class ArchitectVersion
extends java.lang.Object
implements java.lang.Comparable<ArchitectVersion>

The ArchitectVersion class exists as a means of finding out which version of the Architect application you are dealing with. It is also used during the build process in order to determine which version number to put in the archive file names.

It is extremely important that this class has no dependencies aside from the standard Java libraries.


Field Summary
static ArchitectVersion APP_VERSION
          The full version number, formatted as Major.Minor.Tiny[-Suffix].
static java.lang.String APP_VERSION_MAJOR
          The major version number.
static java.lang.String APP_VERSION_MINOR
          Minor version number.
static java.lang.String APP_VERSION_SUFFIX
          Suffixes indicate pre-release builds.
static java.lang.String APP_VERSION_TINY
          Tiny version number.
 
Constructor Summary
ArchitectVersion(java.lang.String version)
          Creates a new ArchitectVersion object from the given string.
 
Method Summary
 int compareTo(ArchitectVersion o)
          ArchitectVersion numbers are mutually comparable even if they have different numbers of parts, and in that case, version 2.0 is older than 2.0.0 or 2.0.1 but still newer than 1.0.0.
 java.lang.Object[] getParts()
          Returns an array of the parts represented by this ArchitectVersion, contents are either Integer or String.
 java.lang.String toString()
          Returns the String representation of this version number in the same format accepted by the ArchitectVersion(String) constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

APP_VERSION_MAJOR

public static final java.lang.String APP_VERSION_MAJOR
The major version number. Currently we're working toward the 1.0 release. This number will become 1 when we are satisfied that the API is feature complete and can remain stable for a period of time. Until then, we will leave the major version at 0 and all bets are off.

See Also:
Constant Field Values

APP_VERSION_MINOR

public static final java.lang.String APP_VERSION_MINOR
Minor version number. This changes when new features appear that might break forward compatibility.

See Also:
Constant Field Values

APP_VERSION_TINY

public static final java.lang.String APP_VERSION_TINY
Tiny version number. This number changes with each release, but resets back to 0 when the minor version changes. All versions under the same minor version number are fully compatible with each other.

See Also:
Constant Field Values

APP_VERSION_SUFFIX

public static final java.lang.String APP_VERSION_SUFFIX
Suffixes indicate pre-release builds. They normally progress from "alpha" to "beta" to "rcN" (release candidate N). This progression is common for a lot of software projects, and has the advantage of sorting alphabetically into the correct order from oldest to newest.

Full releases do not have a suffix. In that case, the suffix is the empty string (not null).

See Also:
Constant Field Values

APP_VERSION

public static final ArchitectVersion APP_VERSION
The full version number, formatted as Major.Minor.Tiny[-Suffix]. Note the square brackets are not part of the version string; they indicate that the hyphen and suffix are omitted when there is no suffix.

Constructor Detail

ArchitectVersion

public ArchitectVersion(java.lang.String version)
Creates a new ArchitectVersion object from the given string. The format is a1.a2.(...).aN[suffix]. Examples: 1.2.3-alpha or 1.3 or 2. The version number must have at least one numeric component, so 1suffix is legal but suffix on its own is not.

Parameters:
version - The version string
Method Detail

toString

public java.lang.String toString()
Returns the String representation of this version number in the same format accepted by the ArchitectVersion(String) constructor.

Overrides:
toString in class java.lang.Object

getParts

public java.lang.Object[] getParts()
Returns an array of the parts represented by this ArchitectVersion, contents are either Integer or String.


compareTo

public int compareTo(ArchitectVersion o)
ArchitectVersion numbers are mutually comparable even if they have different numbers of parts, and in that case, version 2.0 is older than 2.0.0 or 2.0.1 but still newer than 1.0.0.

If two versions differ only as far as one having a suffix and the other not having a suffix, the one without the suffix is considered newer. This allows the natural idea that the following are in chronological order:

Specified by:
compareTo in interface java.lang.Comparable<ArchitectVersion>


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca