public class HyphenationTreeCache extends Object
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<String,String> 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 language
country
- the country (may be null or "none")
public static String constructLlccKey(String lang, String country)
lang
- the language
country
- the country (may be null or "none")
public static String constructUserKey(String lang, String country, Map<String,String> hyphPatNames)
lang
- the language
country
- the country (may be null or "none")
hyphPatNames
- the map of user-configured hyphenation pattern file names
public void cache(String key, HyphenationTree hTree)
key
- the key (ex. "de_CH" or "en")
hTree
- the hyphenation tree
public 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 © 1998–2020 iText Group NV. All rights reserved.