Package localsolver
Class LSVersion
- java.lang.Object
-
- localsolver.LSVersion
-
public class LSVersion extends java.lang.Object
Version, license and copyright info.
-
-
Constructor Summary
Constructors Constructor Description LSVersion()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getBuildDate()
Returns LocalSolver's build date.static java.lang.String
getCopyright()
Returns LocalSolver's copyright as a string.static java.lang.String
getInfo()
Returns version and copyright info as a string.static java.lang.String
getLicenseContent()
Returns the license content previously set withsetLicenseContent(java.lang.String)
or the LS_LICENSE_CONTENT environment variable.static java.lang.String
getLicensePath()
Returns the license path of LocalSolver.static int
getMajorVersionNumber()
Returns LocalSolver's major version number.static int
getMinorVersionNumber()
Returns LocalSolver's minor version number.static java.lang.String
getPlatform()
Returns the platform of the LocalSolver's binary as a string.static java.lang.String
getVersion()
Returns LocalSolver's version as a string.static int
getVersionCode()
Returns LocalSolver's version code as an integer in the range [0, 29999].static void
setLicenseContent(java.lang.String licenseContent)
Changes the license content.static void
setLicensePath(java.lang.String licensePath)
Changes the license path used by LocalSolver.
-
-
-
Method Detail
-
getMajorVersionNumber
public static final int getMajorVersionNumber()
Returns LocalSolver's major version number. This number is an integer in the range [0, 2999].- Returns:
- Major version number.
-
getMinorVersionNumber
public static final int getMinorVersionNumber()
Returns LocalSolver's minor version number. This number is an integer in the range [0, 9].- Returns:
- Minor version number.
-
getBuildDate
public static final int getBuildDate()
Returns LocalSolver's build date. This number is an integer YYYYMMDD with YYYY the year, MM the month, DD the day.- Returns:
- Build date.
-
getPlatform
public static final java.lang.String getPlatform()
Returns the platform of the LocalSolver's binary as a string. The format of the string is PPPPXX where PPPP is the platform (Win, Linux or MacOS) and XX is the architecture (32 or 64 bits).- Returns:
- Platform as string.
- Since:
- 3.0
-
getVersion
public static final java.lang.String getVersion()
Returns LocalSolver's version as a string. The format of the string is: MA.MI.YYYYMMDD-PPPPXX with MA the major number version, MI the minor number version, YYYY the year, MM the month, DD the day, PPPP the platform (Win, Linux or MacOS) and XX the architecture.- Returns:
- Version as string "MA.MI.YYYYMMDD-PPPPXX".
-
getVersionCode
public static final int getVersionCode()
Returns LocalSolver's version code as an integer in the range [0, 29999]. The version code is computed as follows: MA * 10 + MI with MA the major number version, MI the minor number version. Note that the version code can be encoded as a 16-bit integer.- Returns:
- Version code.
-
getCopyright
public static final java.lang.String getCopyright()
Returns LocalSolver's copyright as a string.- Returns:
- Copyright notice.
-
getInfo
public static final java.lang.String getInfo()
Returns version and copyright info as a string.- Returns:
- Version and copyright info.
-
getLicensePath
public static final java.lang.String getLicensePath()
Returns the license path of LocalSolver. By default, LocalSolver looks for a license file in the following locations, in that order:- A file specified by a call to
setLicensePath(java.lang.String)
. - The LS_LICENSE_PATH environment variable.
- A license.dat file in the current directory.
- In the default location (c:\localsolver_X_Y\license.dat on Windows, /opt/localsolver_X_Y/license.dat on Linux and Mac OS).
For windows users: If you used the installer to setup LocalSolver, the LS_LICENSE_PATH environment variable is already defined and points to the license file present in the installation folder.
Note: The license content can also be set directly with
setLicenseContent(java.lang.String)
or with the LS_LICENSE_CONTENT environment variable and this definition will have priority over the license file.- Returns:
- Path to the license
- Since:
- 3.0
- See Also:
setLicensePath(java.lang.String)
,getLicenseContent()
,setLicenseContent(java.lang.String)
- A file specified by a call to
-
setLicensePath
public static final void setLicensePath(java.lang.String licensePath)
Changes the license path used by LocalSolver.- Parameters:
licensePath
- new path for the license- Since:
- 3.0
- See Also:
getLicensePath()
,setLicenseContent(java.lang.String)
,getLicenseContent()
-
getLicenseContent
public static final java.lang.String getLicenseContent()
Returns the license content previously set withsetLicenseContent(java.lang.String)
or the LS_LICENSE_CONTENT environment variable.- Returns:
- The content of the license or an empty string if the content was not set.
- Since:
- 5.0
- See Also:
setLicenseContent(java.lang.String)
,getLicensePath()
,setLicensePath(java.lang.String)
-
setLicenseContent
public static final void setLicenseContent(java.lang.String licenseContent)
Changes the license content. By default, LocalSolver tries to get the license content from the LS_LICENSE_CONTENT environment variable or from the file specified in setLicensePath or in a default location. Use this function to set the license content directly, without using a file.- Parameters:
licenseContent
- content of the license to use.- Since:
- 5.0
- See Also:
getLicenseContent()
,setLicensePath(java.lang.String)
,getLicensePath()
-
-