Top Description Fields Constructors Methods
com.ibm.icu.util

public final Class VersionInfo

extends Object
implements Comparable<VersionInfo>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable
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 VersionInfo
ICU_DATA_VERSION

Data version in ICU4J.

public static final String
ICU_DATA_VERSION_PATH

Data version string for ICU's internal data.

public static final VersionInfo
ICU_VERSION

ICU4J current release version

private static final String
INVALID_VERSION_NUMBER_

Error statement string

private static final int
LAST_BYTE_MASK_

Last byte mask

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, VersionInfo>
MAP_

Map of singletons

private static volatile String
public static final VersionInfo
UCOL_BUILDER_VERSION

Collation builder code version.

public static final VersionInfo
UCOL_RUNTIME_VERSION

Collation runtime version (sort key generator, string comparisons).

public static final VersionInfo
UCOL_TAILORINGS_VERSION

Constant version 1.

public static final VersionInfo
UNICODE_10_0

Unicode 10.0 version

public static final VersionInfo
UNICODE_11_0

Unicode 11.0 version

public static final VersionInfo
UNICODE_12_0

Unicode 12.0 version

public static final VersionInfo
UNICODE_12_1

Unicode 12.1 version

public static final VersionInfo
UNICODE_13_0

Unicode 13.0 version

public static final VersionInfo
UNICODE_14_0

Unicode 14.0 version

public static final VersionInfo
UNICODE_15_0

Unicode 15.0 version

public static final VersionInfo
UNICODE_15_1

Unicode 15.1 version

public static final VersionInfo
UNICODE_1_0

Unicode 1.0 version

public static final VersionInfo
UNICODE_1_0_1

Unicode 1.0.1 version

public static final VersionInfo
UNICODE_1_1_0

Unicode 1.1.0 version

public static final VersionInfo
UNICODE_1_1_5

Unicode 1.1.5 version

public static final VersionInfo
UNICODE_2_0

Unicode 2.0 version

public static final VersionInfo
UNICODE_2_1_2

Unicode 2.1.2 version

public static final VersionInfo
UNICODE_2_1_5

Unicode 2.1.5 version

public static final VersionInfo
UNICODE_2_1_8

Unicode 2.1.8 version

public static final VersionInfo
UNICODE_2_1_9

Unicode 2.1.9 version

public static final VersionInfo
UNICODE_3_0

Unicode 3.0 version

public static final VersionInfo
UNICODE_3_0_1

Unicode 3.0.1 version

public static final VersionInfo
UNICODE_3_1_0

Unicode 3.1.0 version

public static final VersionInfo
UNICODE_3_1_1

Unicode 3.1.1 version

public static final VersionInfo
UNICODE_3_2

Unicode 3.2 version

public static final VersionInfo
UNICODE_4_0

Unicode 4.0 version

public static final VersionInfo
UNICODE_4_0_1

Unicode 4.0.1 version

public static final VersionInfo
UNICODE_4_1

Unicode 4.1 version

public static final VersionInfo
UNICODE_5_0

Unicode 5.0 version

public static final VersionInfo
UNICODE_5_1

Unicode 5.1 version

public static final VersionInfo
UNICODE_5_2

Unicode 5.2 version

public static final VersionInfo
UNICODE_6_0

Unicode 6.0 version

public static final VersionInfo
UNICODE_6_1

Unicode 6.1 version

public static final VersionInfo
UNICODE_6_2

Unicode 6.2 version

public static final VersionInfo
UNICODE_6_3

Unicode 6.3 version

public static final VersionInfo
UNICODE_7_0

Unicode 7.0 version

public static final VersionInfo
UNICODE_8_0

Unicode 8.0 version

public static final VersionInfo
UNICODE_9_0

Unicode 9.0 version

private static final VersionInfo
UNICODE_VERSION

Unicode data version used by the current release.

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 equals 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
)

Implements java.lang.Comparable.compareTo.

Compares other with this VersionInfo.
public boolean

Returns:

true if other is equals to this object's version information, false otherwise
equals
(Object
object to be compared
other
)

Overrides java.lang.Object.equals.

Checks if this version information is equals to the argument version
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.

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
)

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
)

Returns an instance of VersionInfo with the argument version.

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

Returns an instance of VersionInfo with the argument version.

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

Gets the int from the version numbers

public int

Returns:

the major version number
getMajor
()

Returns the major version number

public int

Returns:

the micro version number
getMicro
()

Returns the micro version number

public int

Returns:

the milli version number
getMilli
()

Returns the milli version number

public int

Returns:

the minor version number
getMinor
()

Returns the minor version number

pack-priv static String
public String

Returns:

A tailored version string
getVersionString
(int
Minimum number of version digits
minDigits
,
int
Maximum number of version digits
maxDigits
)

Deprecated This API is ICU internal only. (For use in CLDR, etc.)
Generate version string separated by dots with the specified digit width.
public int

Returns:

the hash code value for this set.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this set.
public static void
main(String[]
arguments (currently not used)
args
)

Main method prints out ICU version information

public String

Returns:

String representative of VersionInfo
toString
()

Overrides java.lang.Object.toString.

Returns the String representative of VersionInfo in the format of "major.minor.milli.micro"
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

ICU_DATA_VERSIONback to summary
public static final VersionInfo ICU_DATA_VERSION

Deprecated

This API is ICU internal only.

Data version in ICU4J.

Annotations
@Deprecated
ICU Status
Internal ICU component.
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 internal data. Used for appending to data path (e.g. icudt43b)

Annotations
@Deprecated
ICU Status
Internal ICU component.
ICU_VERSIONback to summary
public static final VersionInfo ICU_VERSION

ICU4J current release version

ICU Status
Stable since ICU 2.8.
INVALID_VERSION_NUMBER_back to summary
private static final String INVALID_VERSION_NUMBER_

Error statement string

LAST_BYTE_MASK_back to summary
private static final int LAST_BYTE_MASK_

Last byte mask

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, VersionInfo> MAP_

Map of singletons

TZDATA_VERSIONback to summary
private static volatile String TZDATA_VERSION
UCOL_BUILDER_VERSIONback to summary
public static final VersionInfo UCOL_BUILDER_VERSION

Collation builder code version. When this is different, the same tailoring might result in assigning different collation elements to code points. This value may change in subsequent releases of ICU.

ICU Status
Stable since ICU 2.8.
UCOL_RUNTIME_VERSIONback to summary
public static final VersionInfo UCOL_RUNTIME_VERSION

Collation runtime version (sort key generator, string comparisons). If the version is different, sort keys for the same string could be different. This value may change in subsequent releases of ICU.

ICU Status
Stable since ICU 2.8.
UCOL_TAILORINGS_VERSIONback to summary
public static final VersionInfo UCOL_TAILORINGS_VERSION

Deprecated

ICU 54

Constant version 1. This was intended to be the version of collation tailorings, but instead the tailoring data carries a version number.

Annotations
@Deprecated
UNICODE_10_0back to summary
public static final VersionInfo UNICODE_10_0

Unicode 10.0 version

ICU Status
Stable since ICU 60.
UNICODE_11_0back to summary
public static final VersionInfo UNICODE_11_0

Unicode 11.0 version

ICU Status
Stable since ICU 62.
UNICODE_12_0back to summary
public static final VersionInfo UNICODE_12_0

Unicode 12.0 version

ICU Status
Stable since ICU 64.
UNICODE_12_1back to summary
public static final VersionInfo UNICODE_12_1

Unicode 12.1 version

ICU Status
Stable since ICU 64.
UNICODE_13_0back to summary
public static final VersionInfo UNICODE_13_0

Unicode 13.0 version

ICU Status
Stable since ICU 66.
UNICODE_14_0back to summary
public static final VersionInfo UNICODE_14_0

Unicode 14.0 version

ICU Status
Stable since ICU 70.
UNICODE_15_0back to summary
public static final VersionInfo UNICODE_15_0

Unicode 15.0 version

ICU Status
Stable since ICU 72.
UNICODE_15_1back to summary
public static final VersionInfo UNICODE_15_1

Unicode 15.1 version

ICU Status
Stable since ICU 74.
UNICODE_1_0back to summary
public static final VersionInfo UNICODE_1_0

Unicode 1.0 version

ICU Status
Stable since ICU 2.6.
UNICODE_1_0_1back to summary
public static final VersionInfo UNICODE_1_0_1

Unicode 1.0.1 version

ICU Status
Stable since ICU 2.6.
UNICODE_1_1_0back to summary
public static final VersionInfo UNICODE_1_1_0

Unicode 1.1.0 version

ICU Status
Stable since ICU 2.6.
UNICODE_1_1_5back to summary
public static final VersionInfo UNICODE_1_1_5

Unicode 1.1.5 version

ICU Status
Stable since ICU 2.6.
UNICODE_2_0back to summary
public static final VersionInfo UNICODE_2_0

Unicode 2.0 version

ICU Status
Stable since ICU 2.6.
UNICODE_2_1_2back to summary
public static final VersionInfo UNICODE_2_1_2

Unicode 2.1.2 version

ICU Status
Stable since ICU 2.6.
UNICODE_2_1_5back to summary
public static final VersionInfo UNICODE_2_1_5

Unicode 2.1.5 version

ICU Status
Stable since ICU 2.6.
UNICODE_2_1_8back to summary
public static final VersionInfo UNICODE_2_1_8

Unicode 2.1.8 version

ICU Status
Stable since ICU 2.6.
UNICODE_2_1_9back to summary
public static final VersionInfo UNICODE_2_1_9

Unicode 2.1.9 version

ICU Status
Stable since ICU 2.6.
UNICODE_3_0back to summary
public static final VersionInfo UNICODE_3_0

Unicode 3.0 version

ICU Status
Stable since ICU 2.6.
UNICODE_3_0_1back to summary
public static final VersionInfo UNICODE_3_0_1

Unicode 3.0.1 version

ICU Status
Stable since ICU 2.6.
UNICODE_3_1_0back to summary
public static final VersionInfo UNICODE_3_1_0

Unicode 3.1.0 version

ICU Status
Stable since ICU 2.6.
UNICODE_3_1_1back to summary
public static final VersionInfo UNICODE_3_1_1

Unicode 3.1.1 version

ICU Status
Stable since ICU 2.6.
UNICODE_3_2back to summary
public static final VersionInfo UNICODE_3_2

Unicode 3.2 version

ICU Status
Stable since ICU 2.6.
UNICODE_4_0back to summary
public static final VersionInfo UNICODE_4_0

Unicode 4.0 version

ICU Status
Stable since ICU 2.6.
UNICODE_4_0_1back to summary
public static final VersionInfo UNICODE_4_0_1

Unicode 4.0.1 version

ICU Status
Stable since ICU 3.4.
UNICODE_4_1back to summary
public static final VersionInfo UNICODE_4_1

Unicode 4.1 version

ICU Status
Stable since ICU 3.4.
UNICODE_5_0back to summary
public static final VersionInfo UNICODE_5_0

Unicode 5.0 version

ICU Status
Stable since ICU 3.4.
UNICODE_5_1back to summary
public static final VersionInfo UNICODE_5_1

Unicode 5.1 version

ICU Status
Stable since ICU 4.2.
UNICODE_5_2back to summary
public static final VersionInfo UNICODE_5_2

Unicode 5.2 version

ICU Status
Stable since ICU 4.4.
UNICODE_6_0back to summary
public static final VersionInfo UNICODE_6_0

Unicode 6.0 version

ICU Status
Stable since ICU 4.6.
UNICODE_6_1back to summary
public static final VersionInfo UNICODE_6_1

Unicode 6.1 version

ICU Status
Stable since ICU 49.
UNICODE_6_2back to summary
public static final VersionInfo UNICODE_6_2

Unicode 6.2 version

ICU Status
Stable since ICU 50.
UNICODE_6_3back to summary
public static final VersionInfo UNICODE_6_3

Unicode 6.3 version

ICU Status
Stable since ICU 52.
UNICODE_7_0back to summary
public static final VersionInfo UNICODE_7_0

Unicode 7.0 version

ICU Status
Stable since ICU 54.
UNICODE_8_0back to summary
public static final VersionInfo UNICODE_8_0

Unicode 8.0 version

ICU Status
Stable since ICU 56.
UNICODE_9_0back to summary
public static final VersionInfo UNICODE_9_0

Unicode 9.0 version

ICU Status
Stable since ICU 58.
UNICODE_VERSIONback to summary
private static final VersionInfo UNICODE_VERSION

Unicode data version used by the current release. Defined here privately for printing by the main() method in this class. Should be the same as com.ibm.icu.lang.UCharacter#getUnicodeVersion() which gets the version number from a data file. We do not want VersionInfo to have an import dependency on UCharacter.

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)

Implements java.lang.Comparable.compareTo.

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 equals 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.

Annotations
@Override
ICU Status
Stable since ICU 2.6.
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Checks if this version information is equals to the argument version

Parameters
other:Object

object to be compared

Returns:boolean

true if other is equals to this object's version information, false otherwise

Annotations
@Override
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.
getInstanceback to summary
public static VersionInfo getInstance(int major, int minor, int milli)

Returns an instance of VersionInfo with the argument version. Equivalent to getInstance(major, minor, milli, 0).

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.

Exceptions
IllegalArgumentException:
when either arguments are negative or > 255
ICU Status
Stable since ICU 2.6.
getInstanceback to summary
public static VersionInfo getInstance(int major, int minor)

Returns an instance of VersionInfo with the argument version. Equivalent to getInstance(major, minor, 0, 0).

Parameters
major:int

major version, non-negative number <= 255.

minor:int

minor version, non-negative number <= 255.

Exceptions
IllegalArgumentException:
when either arguments are negative or > 255
ICU Status
Stable since ICU 2.6.
getInstanceback to summary
public static VersionInfo getInstance(int major)

Returns an instance of VersionInfo with the argument version. Equivalent to getInstance(major, 0, 0, 0).

Parameters
major:int

major 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-negative version number

milli:int

non-negative version number

micro:int

non-negative version number

getMajorback to summary
public int getMajor()

Returns the major version number

Returns:int

the major version number

ICU Status
Stable since ICU 2.6.
getMicroback to summary
public int getMicro()

Returns the micro version number

Returns:int

the micro version number

ICU Status
Stable since ICU 2.6.
getMilliback to summary
public int getMilli()

Returns the milli version number

Returns:int

the milli version number

ICU Status
Stable since ICU 2.6.
getMinorback to summary
public int getMinor()

Returns the minor version number

Returns:int

the minor version number

ICU Status
Stable since ICU 2.6.
getTZDataVersionback to summary
pack-priv static String getTZDataVersion()
getVersionStringback to summary
public String getVersionString(int minDigits, int maxDigits)

Deprecated

This API is ICU internal only. (For use in CLDR, etc.)

Generate version string separated by dots with the specified digit width. Version digit 0 after minDigits will be trimmed off.

Parameters
minDigits:int

Minimum number of version digits

maxDigits:int

Maximum number of version digits

Returns:String

A tailored version string

Annotations
@Deprecated
ICU Status
Internal ICU component.
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this set.

Returns:int

the hash code value for this set.

Annotations
@Override
ICU Status
Stable since ICU 2.6.
See Also
java.lang.Object#hashCode()
mainback to summary
public static void main(String[] args)

Main method prints out ICU version information

Parameters
args:String[]

arguments (currently not used)

ICU Status
Stable since ICU 4.6.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the String representative of VersionInfo in the format of "major.minor.milli.micro"

Returns:String

String representative of VersionInfo

Annotations
@Override
ICU Status
Stable since ICU 2.6.