jmri
Class Version

Show UML class diagram
java.lang.Object
  extended by jmri.Version

public class Version
extends Object

Defines a simple place to get the JMRI version string.

These JavaDocs are for Version 3.3.7 of JMRI.


This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


Field Summary
static boolean branched
           
static String buildDate
           
static String buildUser
           
static int major
          Major number changes with large incompatible changes in requirements or API.
static int minor
          Minor number changes with each production release.
static boolean official
           
static String revisionId
           
static int test
           
 
Constructor Summary
Version()
           
 
Method Summary
static int compareCanonicalVersions(String version)
          Compares a canonical version string to the JMRI canonical version and returns an integer indicating if the string is less than, equal to, or greater than the JMRI canonical version.
static int compareCanonicalVersions(String version1, String version2)
          Compares two canonical version strings and returns an integer indicating if the first string is less than, equal to, or greater than the second string.
static String getCanonicalVersion()
          Return the version as a major.minor.test String.
static String getCopyright()
          Return the application copyright as a String.
static String getModifier()
           
static boolean isCanonicalVersion(String version)
          Tests that a string contains a canonical version string.
static void main(String[] args)
          Standalone print of version string and exit.
static String name()
          Provide the current version string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

major

public static final int major
Major number changes with large incompatible changes in requirements or API.

See Also:
Constant Field Values

minor

public static final int minor
Minor number changes with each production release. Odd is development, even is production.

See Also:
Constant Field Values

test

public static final int test
See Also:
Constant Field Values

buildUser

public static final String buildUser
See Also:
Constant Field Values

revisionId

public static final String revisionId
See Also:
Constant Field Values

buildDate

public static final String buildDate
See Also:
Constant Field Values

official

public static final boolean official
See Also:
Constant Field Values

branched

public static final boolean branched
See Also:
Constant Field Values
Constructor Detail

Version

public Version()
Method Detail

getModifier

public static String getModifier()

name

public static String name()
Provide the current version string.

This string is built using various known build parameters, including the release.{major,minor,build} values, the SVN revision ID (if known) and the branched & release.official statuses.

Returns:
The current version string

isCanonicalVersion

public static boolean isCanonicalVersion(String version)
Tests that a string contains a canonical version string.

A canonical version string is a string in the form x.y.z and is different than the version string displayed using name(). The canonical version string for a JMRI instance is available using getCanonicalVersion().

Parameters:
version -
Returns:
true if version is a canonical version string

compareCanonicalVersions

public static int compareCanonicalVersions(String version)
                                    throws IllegalArgumentException
Compares a canonical version string to the JMRI canonical version and returns an integer indicating if the string is less than, equal to, or greater than the JMRI canonical version.

Parameters:
version -
Returns:
-1, 0, or 1 if version is less than, equal to, or greater than JMRI canonical version
Throws:
IllegalArgumentException - if version is not a canonical version string
See Also:
Comparable.compareTo(java.lang.Object)

compareCanonicalVersions

public static int compareCanonicalVersions(String version1,
                                           String version2)
                                    throws IllegalArgumentException
Compares two canonical version strings and returns an integer indicating if the first string is less than, equal to, or greater than the second string.

Parameters:
version1 - a canonical version string
version2 - a canonical version string
Returns:
-1, 0, or 1 if version1 is less than, equal to, or greater than version2
Throws:
IllegalArgumentException - if either version string is not a canonical version string
See Also:
Comparable.compareTo(java.lang.Object)

getCanonicalVersion

public static String getCanonicalVersion()
Return the version as a major.minor.test String.

Returns:
The version

getCopyright

public static String getCopyright()
Return the application copyright as a String.

Returns:
The copyright

main

public static void main(String[] args)
Standalone print of version string and exit. This is used in the build.xml to generate parts of the installer release file name, so take care in altering this code to make sure the ant recipes are also suitably modified.



Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads