org.apache.fop.hyphenation
Class HyphenationTreeCache
java.lang.Object
org.apache.fop.hyphenation.HyphenationTreeCache
public class HyphenationTreeCache
extends java.lang.Object
This is a cache for HyphenationTree instances.
void | cache(String key, HyphenationTree hTree) - Cache a hyphenation tree under its key.
|
static String | constructKey(String lang, String country) - Constructs the key for the hyphenation pattern file.
|
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.
|
cache
public void cache(String key,
HyphenationTree hTree)
Cache a hyphenation tree under its key.
key
- the key (ex. "de_CH" or "en")hTree
- the hyphenation tree
constructKey
public static String constructKey(String lang,
String country)
Constructs the key for the hyphenation pattern file.
lang
- the languagecountry
- the country (may be null or "none")
getHyphenationTree
public HyphenationTree getHyphenationTree(String lang,
String country)
Looks in the cache if a hyphenation tree is available and returns it if it is found.
lang
- the languagecountry
- the country (may be null or "none")
- the HyhenationTree instance or null if it's not in the cache
isMissing
public boolean isMissing(String key)
Indicates whether a hyphenation file has been requested before but it wasn't available.
This is to avoid searching a second time for a hyphneation pattern file which is not
available.
key
- the key (ex. "de_CH" or "en")
- true if the hyphenation tree is unavailable
noteMissing
public void noteMissing(String key)
Notes a key to a hyphenation tree as missing.
This is to avoid searching a second time for a hyphneation pattern file which is not
available.
key
- the key (ex. "de_CH" or "en")
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.