fop 1.0

org.apache.fop.hyphenation
Class HyphenationTreeCache

java.lang.Object
  extended by org.apache.fop.hyphenation.HyphenationTreeCache

public class HyphenationTreeCache
extends java.lang.Object

This is a cache for HyphenationTree instances.


Constructor Summary
HyphenationTreeCache()
           
 
Method Summary
 void cache(java.lang.String key, HyphenationTree hTree)
          Cache a hyphenation tree under its key.
static java.lang.String constructKey(java.lang.String lang, java.lang.String country)
          Constructs the key for the hyphenation pattern file.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HyphenationTreeCache

public HyphenationTreeCache()
Method Detail

getHyphenationTree

public 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.

Parameters:
lang - the language
country - the country (may be null or "none")
Returns:
the HyhenationTree instance or null if it's not in the cache

constructKey

public static java.lang.String constructKey(java.lang.String lang,
                                            java.lang.String country)
Constructs the key for the hyphenation pattern file.

Parameters:
lang - the language
country - the country (may be null or "none")
Returns:
the resulting key

cache

public void cache(java.lang.String key,
                  HyphenationTree hTree)
Cache a hyphenation tree under its key.

Parameters:
key - the key (ex. "de_CH" or "en")
hTree - the hyphenation tree

noteMissing

public void noteMissing(java.lang.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.

Parameters:
key - the key (ex. "de_CH" or "en")

isMissing

public boolean isMissing(java.lang.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.

Parameters:
key - the key (ex. "de_CH" or "en")
Returns:
true if the hyphenation tree is unavailable

fop 1.0

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.