public class HyphenationTreeCache extends Object
This is a cache for HyphenationTree instances.
| Constructor and Description |
|---|
HyphenationTreeCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
cache(String key,
HyphenationTree hTree)
Cache a hyphenation tree under its key.
|
static String |
constructLlccKey(String lang,
String country)
Constructs the key for the hyphenation pattern file.
|
static String |
constructUserKey(String lang,
String country,
Map hyphPatNames)
If the user configured a hyphenation pattern file name
for this (lang,country) value, return it.
|
HyphenationTree |
getHyphenationTree(String lang,
String country)
Looks in the cache if a hyphenation tree is available and returns it if it is found.
|
boolean |
isMissing(String key)
Indicates whether a hyphenation file has been requested before but it wasn't available.
|
void |
noteMissing(String key)
Notes a key to a hyphenation tree as missing.
|
public HyphenationTree getHyphenationTree(String lang, String country)
lang - the languagecountry - the country (may be null or "none")public static String constructLlccKey(String lang, String country)
lang - the languagecountry - the country (may be null or "none")public static String constructUserKey(String lang, String country, Map hyphPatNames)
lang - the languagecountry - the country (may be null or "none")hyphPatNames - the map of user-configured hyphenation pattern file namespublic void cache(String key, HyphenationTree hTree)
key - the key (ex. "de_CH" or "en")hTree - the hyphenation treepublic void noteMissing(String key)
key - the key (ex. "de_CH" or "en")public boolean isMissing(String key)
key - the key (ex. "de_CH" or "en")Copyright © 2023 Apache Software Foundation. All rights reserved.