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