APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.icu.util

public final Class VersionInfo

extends Object
Class Inheritance
Imports
java.util.concurrent.ConcurrentHashMap

Class to store version numbers of the form major.minor.milli.micro.
Author
synwee
ICU Status
Stable since ICU 2.6.

Field Summary

Modifier and TypeField and Description
public static final String
ICU_DATA_VERSION_PATH

Deprecated This API is ICU internal only.
Data version string for ICU's data file.
private static final String
INVALID_VERSION_NUMBER_

Error statement string

private int
m_version_

Version number stored as a byte for each of the major, minor, milli and micro numbers in the 32 bit int.

private static final ConcurrentHashMap<Integer, Object>
MAP_

Map of singletons

Constructor Summary

AccessConstructor and Description
private
VersionInfo(int
a 32 bit int with each byte representing a number
compactversion
)

Constructor with int

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

0 if the argument is a VersionInfo object that has version information equal to this object. Less than 0 if the argument is a VersionInfo object that has version information greater than this object. Greater than 0 if the argument is a VersionInfo object that has version information less than this object.
compareTo
(VersionInfo
VersionInfo to be compared
other
)

Compares other with this VersionInfo.

public static VersionInfo

Returns:

an instance of VersionInfo with the argument version.
getInstance
(String
version String in the format of "major.minor.milli.micro" or "major.minor.milli" or "major.minor" or "major", where major, minor, milli, micro are non-negative numbers <= 255. If the trailing version numbers are not specified they are taken as 0s. E.g. Version "3.1" is equivalent to "3.1.0.0".
version
)

Returns an instance of VersionInfo with the argument version.

public static VersionInfo
getInstance(int
major version, non-negative number <= 255.
major
,
int
minor version, non-negative number <= 255.
minor
,
int
milli version, non-negative number <= 255.
milli
,
int
micro version, non-negative number <= 255.
micro
)

Returns an instance of VersionInfo with the argument version.

private static int
getInt(int
non-negative version number
major
,
int
non-negativeversion number
minor
,
int
non-negativeversion number
milli
,
int
non-negativeversion number
micro
)

Gets the int from the version numbers

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ICU_DATA_VERSION_PATHback to summary
public static final String ICU_DATA_VERSION_PATH

Deprecated

This API is ICU internal only.

Data version string for ICU's data file. Not used when loading from resources packaged in the .jar.

Annotations
@Deprecated
ICU Status
Internal ICU component.
INVALID_VERSION_NUMBER_back to summary
private static final String INVALID_VERSION_NUMBER_

Error statement string

m_version_back to summary
private int m_version_

Version number stored as a byte for each of the major, minor, milli and micro numbers in the 32 bit int. Most significant for the major and the least significant contains the micro numbers.

MAP_back to summary
private static final ConcurrentHashMap<Integer, Object> MAP_

Map of singletons

Constructor Detail

VersionInfoback to summary
private VersionInfo(int compactversion)

Constructor with int

Parameters
compactversion:int

a 32 bit int with each byte representing a number

Method Detail

compareToback to summary
public int compareTo(VersionInfo other)

Compares other with this VersionInfo.

Parameters
other:VersionInfo

VersionInfo to be compared

Returns:int

0 if the argument is a VersionInfo object that has version information equal to this object. Less than 0 if the argument is a VersionInfo object that has version information greater than this object. Greater than 0 if the argument is a VersionInfo object that has version information less than this object.

ICU Status
Stable since ICU 2.6.
getInstanceback to summary
public static VersionInfo getInstance(String version)

Returns an instance of VersionInfo with the argument version.

Parameters
version:String

version String in the format of "major.minor.milli.micro" or "major.minor.milli" or "major.minor" or "major", where major, minor, milli, micro are non-negative numbers <= 255. If the trailing version numbers are not specified they are taken as 0s. E.g. Version "3.1" is equivalent to "3.1.0.0".

Returns:VersionInfo

an instance of VersionInfo with the argument version.

Exceptions
IllegalArgumentException:
when the argument version is not in the right format
ICU Status
Stable since ICU 2.6.
getInstanceback to summary
public static VersionInfo getInstance(int major, int minor, int milli, int micro)

Returns an instance of VersionInfo with the argument version.

Parameters
major:int

major version, non-negative number <= 255.

minor:int

minor version, non-negative number <= 255.

milli:int

milli version, non-negative number <= 255.

micro:int

micro version, non-negative number <= 255.

Exceptions
IllegalArgumentException:
when either arguments are negative or > 255
ICU Status
Stable since ICU 2.6.
getIntback to summary
private static int getInt(int major, int minor, int milli, int micro)

Gets the int from the version numbers

Parameters
major:int

non-negative version number

minor:int

non-negativeversion number

milli:int

non-negativeversion number

micro:int

non-negativeversion number