/* * Moonlight|3D * Copyright (C) 2007 The Moonlight|3D team * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Created on Sep 18, 2007 */ package eu.moonlight3d.framework; /** * Version information for an application based on the Moonlight application framework. * This class stores an application name and version and is used to brand the * Moonlight application framework for the application built on top of it. * * @author gregor */ public class VersionInformation { /** * The name of the application on top of this framework. */ private String applicationName; /** * The major version number of the application. */ private int major; /** * The minor version number of the application. */ private int minor; /** * the patch version number of the application. */ private int patch; /** * Construct a VersionInformation with the given data. This data * cannot be changed anymore after construction. * * @param applicationName the name of the application * @param major the major version number of the application * @param minor the minor version number of the application * @param patch the patch version number of the application */ public VersionInformation(String applicationName, int major, int minor, int patch) { this.applicationName=applicationName; this.major=major; this.minor=minor; this.patch=patch; } /** * Return the unaltered application name. * * @return original application name */ public String getApplicationName() { return applicationName; } /** * Return the major version number. * * @return major version number */ public int getMajor() { return major; } /** * Return the minor version number. * * @return minor version number */ public int getMinor() { return minor; } /** * Return the patch version number. * * @return patch version number */ public int getPatch() { return patch; } /** * Return the version information in a string of the format * [major].[minor].[patch]. * * @return the version string */ public String getVersionString() { return major + "." + minor + "." + patch; } /** * Return the application name and version information in a * string of the format [appname] [major].[minor].[patch]. * * @return the application name and version in printable format */ public String getApplicationVersionString() { return applicationName + " " + getVersionString(); } }