soc.util
Class Version

java.lang.Object
  extended by soc.util.Version

public class Version
extends java.lang.Object

Package level version file used to keep packaging and codebase in sync. The file Version.java.in is filtered to create Version.java when Callisto is built using ant. If you are not using ant to build Callisto you can do this manually by copying Version.java.in to Version.java, replacing "@ VERSION @" with the "version" property value in the file build.xml.

Author:
Chadwick A. McHenry

Field Summary
static java.lang.String BUILDNUM
           
static java.lang.String COPYRIGHT
           
static java.lang.String JRE_MIN_EDIT
           
static java.lang.String JRE_MIN_MAJOR
           
static java.lang.String JRE_MIN_MINOR
           
static java.lang.String JRE_MIN_VERSION
           
private static int jreMinEdit
           
private static int jreMinMajor
          ints for comparisons, concatentated and stored as JRE_MIN_VERSION
private static int jreMinMinor
           
static java.lang.String VERSION
           
private static java.util.Properties versionInfo
          Current version info
static java.lang.String VERSNUM
           
static java.lang.String VERSNUM_NOWARN_MAXIMUM
          For minimum version required; warn in NewGameOptionsFrame only if game options require newer than this version number.
 
Constructor Summary
Version()
           
 
Method Summary
static java.lang.String buildnum()
          Return the build-number string.
static java.lang.String copyright()
          Return the copyright string.
(package private) static boolean isJREValid()
          Check for sufficient version of the JRE.
static java.lang.String minJREVersion()
          Return the minimum required jre.
static void printVersionText(java.io.PrintStream out, java.lang.String progname)
          Print the JSettlers version banner and attribution text.
static java.lang.String version()
          Return the current version string.
static java.lang.String version(int versionNumber)
          Given a version number integer such as 1109, return a human-readable string such as "1.1.09".
static int versionNumber()
          Return the current version number.
static int versionNumberMaximumNoWarn()
          For new game creation, return the minimum recent version number to not warn during new game creation; should be a version released more than a year ago.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static java.lang.String VERSION

VERSNUM

public static java.lang.String VERSNUM

VERSNUM_NOWARN_MAXIMUM

public static final java.lang.String VERSNUM_NOWARN_MAXIMUM
For minimum version required; warn in NewGameOptionsFrame only if game options require newer than this version number. Property name versionnumMaxNoWarn in build.xml.

Since:
1.1.13
See Also:
versionNumberMaximumNoWarn(), Constant Field Values

COPYRIGHT

public static java.lang.String COPYRIGHT

BUILDNUM

public static java.lang.String BUILDNUM

JRE_MIN_VERSION

public static java.lang.String JRE_MIN_VERSION

JRE_MIN_MAJOR

public static java.lang.String JRE_MIN_MAJOR

JRE_MIN_MINOR

public static java.lang.String JRE_MIN_MINOR

JRE_MIN_EDIT

public static java.lang.String JRE_MIN_EDIT

versionInfo

private static java.util.Properties versionInfo
Current version info


jreMinMajor

private static int jreMinMajor
ints for comparisons, concatentated and stored as JRE_MIN_VERSION


jreMinMinor

private static int jreMinMinor

jreMinEdit

private static int jreMinEdit
Constructor Detail

Version

public Version()
Method Detail

version

public static java.lang.String version(int versionNumber)
Given a version number integer such as 1109, return a human-readable string such as "1.1.09".

Parameters:
versionNumber - a version number, as returned by versionNumber(), which should be 0 or an integer 1000 or higher
Returns:
version as a human-readable string such as "1.1.09"
Since:
1.1.09
See Also:
version()

version

public static java.lang.String version()
Return the current version string. @see #versionNumber()


versionNumber

public static int versionNumber()
Return the current version number.

Returns:
Version integer; 1100 is version 1.1.00. If the version number cannot be read, 0 is returned.
See Also:
version(), version(int)

versionNumberMaximumNoWarn

public static int versionNumberMaximumNoWarn()
For new game creation, return the minimum recent version number to not warn during new game creation; should be a version released more than a year ago. If game options require a newer version, warn about that in the NewGameOptionsFrame options dialog.

To view or set this version, see VERSNUM_NOWARN_MAXIMUM.

Returns:
Version integer; 1108 is version 1.1.08. If the version number cannot be read, -1 is returned.
Since:
1.1.13
See Also:
versionNumber()

copyright

public static java.lang.String copyright()
Return the copyright string.


buildnum

public static java.lang.String buildnum()
Return the build-number string.


minJREVersion

public static java.lang.String minJREVersion()
Return the minimum required jre.


isJREValid

static boolean isJREValid()
Check for sufficient version of the JRE.


printVersionText

public static void printVersionText(java.io.PrintStream out,
                                    java.lang.String progname)
Print the JSettlers version banner and attribution text. Formerly inside SOCPlayerClient, SOCServer.

Parameters:
out - System.out or System.err
progname - "Java Settlers Server " or "Java Settlers Client ", including trailing space
Since:
1.1.18