Package com.lowagie.text.pdf.hyphenation
Class Hyphenator
- java.lang.Object
-
- com.lowagie.text.pdf.hyphenation.Hyphenator
-
public class Hyphenator extends java.lang.Object
This class is the main entry point to the hyphenation package. You can use only the static methods or create an instance.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
defaultHyphLocation
private static java.lang.String
hyphenDir
Holds value of property hyphenDir.private HyphenationTree
hyphenTree
private static java.util.Map<java.lang.String,HyphenationTree>
hyphenTrees
TODO: Don't use staticsprivate int
pushCharCount
private int
remainCharCount
-
Constructor Summary
Constructors Constructor Description Hyphenator(java.lang.String lang, java.lang.String country, int leftMin, int rightMin)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HyphenationTree
getFileHyphenationTree(java.lang.String key)
static HyphenationTree
getHyphenationTree(java.lang.String lang, java.lang.String country)
static java.lang.String
getHyphenDir()
Getter for property hyphenDir.private static java.io.File
getHyphenFile(java.lang.String key)
static HyphenationTree
getResourceHyphenationTree(java.lang.String key)
Hyphenation
hyphenate(char[] word, int offset, int len)
Hyphenation
hyphenate(java.lang.String word)
static Hyphenation
hyphenate(java.lang.String lang, java.lang.String country, char[] word, int offset, int len, int leftMin, int rightMin)
static Hyphenation
hyphenate(java.lang.String lang, java.lang.String country, java.lang.String word, int leftMin, int rightMin)
private static java.io.InputStream
readHyphenationFile(java.lang.String key)
static void
setHyphenDir(java.lang.String _hyphenDir)
Setter for property hyphenDir.void
setLanguage(java.lang.String lang, java.lang.String country)
void
setMinPushCharCount(int min)
void
setMinRemainCharCount(int min)
-
-
-
Field Detail
-
defaultHyphLocation
private static final java.lang.String defaultHyphLocation
- See Also:
- Constant Field Values
-
hyphenTrees
private static java.util.Map<java.lang.String,HyphenationTree> hyphenTrees
TODO: Don't use statics
-
hyphenDir
private static java.lang.String hyphenDir
Holds value of property hyphenDir.
-
hyphenTree
private HyphenationTree hyphenTree
-
remainCharCount
private int remainCharCount
-
pushCharCount
private int pushCharCount
-
-
Method Detail
-
getHyphenationTree
public static HyphenationTree getHyphenationTree(java.lang.String lang, java.lang.String country)
- Parameters:
lang
- The languagecountry
- The country- Returns:
- the hyphenation tree
-
getResourceHyphenationTree
public static HyphenationTree getResourceHyphenationTree(java.lang.String key)
- Parameters:
key
- A String of the key of the hyphenation tree- Returns:
- a hyphenation tree
-
readHyphenationFile
private static java.io.InputStream readHyphenationFile(java.lang.String key)
-
getFileHyphenationTree
public static HyphenationTree getFileHyphenationTree(java.lang.String key)
- Parameters:
key
- The language to get the tree from- Returns:
- a hyphenation tree or null
-
getHyphenFile
private static java.io.File getHyphenFile(java.lang.String key)
-
hyphenate
public static Hyphenation hyphenate(java.lang.String lang, java.lang.String country, java.lang.String word, int leftMin, int rightMin)
- Parameters:
lang
- The languagecountry
- The countryword
- char array containing the wordleftMin
- Minimum number of characters allowed before the hyphenation pointrightMin
- Minimum number of characters allowed after the hyphenation point- Returns:
- a hyphenation object
-
hyphenate
public static Hyphenation hyphenate(java.lang.String lang, java.lang.String country, char[] word, int offset, int len, int leftMin, int rightMin)
- Parameters:
lang
- The languagecountry
- The countryword
- char array that contains the word to hyphenateoffset
- Offset to the first character in wordlen
- The length of the wordleftMin
- Minimum number of characters allowed before the hyphenation pointrightMin
- Minimum number of characters allowed after the hyphenation point- Returns:
- a hyphenation object
-
getHyphenDir
public static java.lang.String getHyphenDir()
Getter for property hyphenDir.- Returns:
- Value of property hyphenDir.
-
setHyphenDir
public static void setHyphenDir(java.lang.String _hyphenDir)
Setter for property hyphenDir.- Parameters:
_hyphenDir
- New value of property hyphenDir.
-
setMinRemainCharCount
public void setMinRemainCharCount(int min)
- Parameters:
min
- Minimum number of characters allowed before the hyphenation point
-
setMinPushCharCount
public void setMinPushCharCount(int min)
- Parameters:
min
- Minimum number of characters allowed after the hyphenation point
-
setLanguage
public void setLanguage(java.lang.String lang, java.lang.String country)
- Parameters:
lang
- The languagecountry
- The country
-
hyphenate
public Hyphenation hyphenate(char[] word, int offset, int len)
- Parameters:
word
- Char array that contains the wordoffset
- Offset to the first character in wordlen
- Length of the word- Returns:
- a hyphenation object
-
hyphenate
public Hyphenation hyphenate(java.lang.String word)
- Parameters:
word
- The word to hyphenate- Returns:
- a hyphenation object
-
-