Package com.lowagie.text.pdf.hyphenation
Class Hyphenator
- java.lang.Object
-
- com.lowagie.text.pdf.hyphenation.Hyphenator
-
public class Hyphenator extends Object
This class is the main entry point to the hyphenation package. You can use only the static methods or create an instance.- Author:
- Carlos Villegas
-
-
Constructor Summary
Constructors Constructor Description Hyphenator(String lang, String country, int leftMin, int rightMin)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HyphenationTreegetFileHyphenationTree(String key)static HyphenationTreegetHyphenationTree(String lang, String country)static StringgetHyphenDir()Getter for property hyphenDir.static HyphenationTreegetResourceHyphenationTree(String key)Hyphenationhyphenate(char[] word, int offset, int len)Hyphenationhyphenate(String word)static Hyphenationhyphenate(String lang, String country, char[] word, int offset, int len, int leftMin, int rightMin)static Hyphenationhyphenate(String lang, String country, String word, int leftMin, int rightMin)static voidsetHyphenDir(String _hyphenDir)Setter for property hyphenDir.voidsetLanguage(String lang, String country)voidsetMinPushCharCount(int min)voidsetMinRemainCharCount(int min)
-
-
-
Method Detail
-
getHyphenationTree
public static HyphenationTree getHyphenationTree(String lang, String country)
- Parameters:
lang- The languagecountry- The country- Returns:
- the hyphenation tree
-
getResourceHyphenationTree
public static HyphenationTree getResourceHyphenationTree(String key)
- Parameters:
key- A String of the key of the hyphenation tree- Returns:
- a hyphenation tree
-
getFileHyphenationTree
public static HyphenationTree getFileHyphenationTree(String key)
- Parameters:
key- The language to get the tree from- Returns:
- a hyphenation tree
-
hyphenate
public static Hyphenation hyphenate(String lang, String country, 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(String 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
-
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(String 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(String word)
- Parameters:
word- The word to hyphenate- Returns:
- a hyphenation object
-
getHyphenDir
public static String getHyphenDir()
Getter for property hyphenDir.- Returns:
- Value of property hyphenDir.
-
setHyphenDir
public static void setHyphenDir(String _hyphenDir)
Setter for property hyphenDir.- Parameters:
_hyphenDir- New value of property hyphenDir.
-
-