Class HyphenationTreeCache
- Namespace
- iText.Layout.Hyphenation
- Assembly
- itext.layout.dll
This is a cache for HyphenationTree instances.
public class HyphenationTreeCache
- Inheritance
-
HyphenationTreeCache
- Inherited Members
Constructors
HyphenationTreeCache()
public HyphenationTreeCache()
Methods
Cache(string, HyphenationTree)
Cache a hyphenation tree under its key.
public virtual void Cache(string key, HyphenationTree hTree)
Parameters
key
stringthe key (ex. "de_CH" or "en")
hTree
HyphenationTreethe hyphenation tree
ConstructLlccKey(string, string)
Constructs the key for the hyphenation pattern file.
public static string ConstructLlccKey(string lang, string country)
Parameters
Returns
- string
the resulting key
ConstructUserKey(string, string, IDictionary<string, string>)
If the user configured a hyphenation pattern file name for this (lang,country) value, return it.
public static string ConstructUserKey(string lang, string country, IDictionary<string, string> hyphPatNames)
Parameters
lang
stringthe language
country
stringthe country (may be null or "none")
hyphPatNames
IDictionary<string, string>the map of user-configured hyphenation pattern file names
Returns
- string
the hyphenation pattern file name or null
Remarks
If the user configured a hyphenation pattern file name for this (lang,country) value, return it. If not, return null.
GetHyphenationTree(string, string)
Looks in the cache if a hyphenation tree is available and returns it if it is found.
public virtual HyphenationTree GetHyphenationTree(string lang, string country)
Parameters
Returns
- HyphenationTree
the HyhenationTree instance or null if it's not in the cache
IsMissing(string)
Indicates whether a hyphenation file has been requested before but it wasn't available.
public virtual bool IsMissing(string key)
Parameters
key
stringthe key (ex. "de_CH" or "en")
Returns
- bool
true if the hyphenation tree is unavailable
Remarks
Indicates whether a hyphenation file has been requested before but it wasn't available. This is to avoid searching a second time for a hyphenation pattern file which is not available.
NoteMissing(string)
Notes a key to a hyphenation tree as missing.
public virtual void NoteMissing(string key)
Parameters
key
stringthe key (ex. "de_CH" or "en")
Remarks
Notes a key to a hyphenation tree as missing. This is to avoid searching a second time for a hyphenation pattern file which is not available.