Class LocaleDistance
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.locale.LocaleDistance
Offline-built data for LocaleMatcher.
Mostly but not only the data for mapping locales to their maximized forms.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDistance value bit flag, set by the builder.static final intBit flag used on the last character of a subtag in the trie.static final LocaleDistancestatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionintgetBestIndexAndDistance(LSR desired, LSR[] supportedLSRs, int supportedLSRsLength, int shiftedThreshold, LocaleMatcher.FavorSubtag favorSubtag, LocaleMatcher.Direction direction) Finds the supported LSR with the smallest distance from the desired one.intintstatic final doublegetDistanceDouble(int indexAndDistance) static final intgetDistanceFloor(int indexAndDistance) static final intgetIndex(int indexAndDistance) static final intgetShiftedDistance(int indexAndDistance) booleanisParadigmLSR(LSR lsr) static final intshiftDistance(int distance) inttestOnlyDistance(ULocale desired, ULocale supported, int threshold, LocaleMatcher.FavorSubtag favorSubtag) voidtoString()
-
Field Details
-
END_OF_SUBTAG
public static final int END_OF_SUBTAGBit flag used on the last character of a subtag in the trie. Must be set consistently by the builder and the lookup code.- See Also:
-
DISTANCE_SKIP_SCRIPT
public static final int DISTANCE_SKIP_SCRIPTDistance value bit flag, set by the builder.- See Also:
-
IX_DEF_LANG_DISTANCE
public static final int IX_DEF_LANG_DISTANCE- See Also:
-
IX_DEF_SCRIPT_DISTANCE
public static final int IX_DEF_SCRIPT_DISTANCE- See Also:
-
IX_DEF_REGION_DISTANCE
public static final int IX_DEF_REGION_DISTANCE- See Also:
-
IX_MIN_REGION_DISTANCE
public static final int IX_MIN_REGION_DISTANCE- See Also:
-
IX_LIMIT
public static final int IX_LIMIT- See Also:
-
INSTANCE
-
-
Method Details
-
shiftDistance
public static final int shiftDistance(int distance) -
getShiftedDistance
public static final int getShiftedDistance(int indexAndDistance) -
getDistanceDouble
public static final double getDistanceDouble(int indexAndDistance) -
getDistanceFloor
public static final int getDistanceFloor(int indexAndDistance) -
getIndex
public static final int getIndex(int indexAndDistance) -
testOnlyDistance
public int testOnlyDistance(ULocale desired, ULocale supported, int threshold, LocaleMatcher.FavorSubtag favorSubtag) -
getBestIndexAndDistance
public int getBestIndexAndDistance(LSR desired, LSR[] supportedLSRs, int supportedLSRsLength, int shiftedThreshold, LocaleMatcher.FavorSubtag favorSubtag, LocaleMatcher.Direction direction) Finds the supported LSR with the smallest distance from the desired one. Equivalent LSR subtags must be normalized into a canonical form.Returns the index of the lowest-distance supported LSR in the high bits (negative if none has a distance below the threshold), and its distance (0..ABOVE_THRESHOLD) in the low bits.
-
toString
-
isParadigmLSR
-
getDefaultScriptDistance
public int getDefaultScriptDistance() -
getDefaultDemotionPerDesiredLocale
public int getDefaultDemotionPerDesiredLocale() -
testOnlyGetDistanceTable
-
testOnlyPrintDistanceTable
public void testOnlyPrintDistanceTable()
-