public class LocaleDistance extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LocaleDistance.Data |
| Modifier and Type | Field and Description |
|---|---|
static int |
DISTANCE_SKIP_SCRIPT
Distance value bit flag, set by the builder.
|
static int |
END_OF_SUBTAG
Bit flag used on the last character of a subtag in the trie.
|
static LocaleDistance |
INSTANCE |
static int |
IX_DEF_LANG_DISTANCE |
static int |
IX_DEF_REGION_DISTANCE |
static int |
IX_DEF_SCRIPT_DISTANCE |
static int |
IX_LIMIT |
static int |
IX_MIN_REGION_DISTANCE |
| Modifier and Type | Method and Description |
|---|---|
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.
|
int |
getDefaultDemotionPerDesiredLocale() |
int |
getDefaultScriptDistance() |
static double |
getDistanceDouble(int indexAndDistance) |
static int |
getDistanceFloor(int indexAndDistance) |
static int |
getIndex(int indexAndDistance) |
static int |
getShiftedDistance(int indexAndDistance) |
boolean |
isParadigmLSR(LSR lsr) |
static int |
shiftDistance(int distance) |
int |
testOnlyDistance(ULocale desired,
ULocale supported,
int threshold,
LocaleMatcher.FavorSubtag favorSubtag) |
Map<String,Integer> |
testOnlyGetDistanceTable() |
void |
testOnlyPrintDistanceTable() |
String |
toString() |
public static final int END_OF_SUBTAG
public static final int DISTANCE_SKIP_SCRIPT
public static final int IX_DEF_LANG_DISTANCE
public static final int IX_DEF_SCRIPT_DISTANCE
public static final int IX_DEF_REGION_DISTANCE
public static final int IX_MIN_REGION_DISTANCE
public static final int IX_LIMIT
public static final LocaleDistance INSTANCE
public static final int shiftDistance(int distance)
public static final int getShiftedDistance(int indexAndDistance)
public static final double getDistanceDouble(int indexAndDistance)
public static final int getDistanceFloor(int indexAndDistance)
public static final int getIndex(int indexAndDistance)
public int testOnlyDistance(ULocale desired, ULocale supported, int threshold, LocaleMatcher.FavorSubtag favorSubtag)
public int getBestIndexAndDistance(LSR desired, LSR[] supportedLSRs, int supportedLSRsLength, int shiftedThreshold, LocaleMatcher.FavorSubtag favorSubtag, LocaleMatcher.Direction direction)
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.
public boolean isParadigmLSR(LSR lsr)
public int getDefaultScriptDistance()
public int getDefaultDemotionPerDesiredLocale()
public void testOnlyPrintDistanceTable()