public class HyphenationImpl extends Object implements Hyphenation
Hyphenation interface.| Modifier and Type | Field and Description |
|---|---|
private char |
hyphen |
private int[] |
hyphenationPoints |
private String |
word |
| Constructor and Description |
|---|
HyphenationImpl(String hyphenatedWord)
The constructor.
|
HyphenationImpl(String hyphenatedWord,
char hyphen)
The constructor.
|
HyphenationImpl(String word,
char hyphen,
int[] hyphenationPoints)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
char |
getHyphen() |
int |
getHyphenation(int hyphenationIndex)
This method gets the index of the given hyphenation-point.
|
int |
getHyphenationBefore(int offset)
This method gets the greatest
hyphenation position that is less to the given
offset. |
int |
getHyphenationCount()
This method gets the number of hyphenation-points in the word.
|
int[] |
getHyphenationPoints() |
String |
getWord()
This method gets the raw word to be hyphenated.
|
String |
toString()
The hyphenation of the according word (e.g.
|
private final String word
private final int[] hyphenationPoints
private final char hyphen
public HyphenationImpl(String word, char hyphen, int[] hyphenationPoints)
word - is the word.hyphen - is the hyphen-character.hyphenationPoints - are the actual hyphenation-points.public HyphenationImpl(String hyphenatedWord)
hyphenatedWord - is the hyphenated word.public HyphenationImpl(String hyphenatedWord, char hyphen)
hyphenatedWord - is the hyphenated word.hyphen - is the hyphen-character.public int getHyphenationCount()
HyphenationgetHyphenationCount in interface Hyphenation0 for "I" or "egg" or 1 for "im-pact").public int getHyphenation(int hyphenationIndex)
HyphenationgetHyphenation in interface HyphenationhyphenationIndex - is the index of the hyphenation-point in the range from 0 to
Hyphenation.getHyphenationCount() - 1.word.public int getHyphenationBefore(int offset)
Hyphenationhyphenation position that is less to the given
offset.getHyphenationBefore in interface Hyphenationoffset - is the offset in the word where a hyphenation is desired.hyphenation position just before the given offset or -1 if
there is no such position.public int[] getHyphenationPoints()
public String getWord()
HyphenationgetWord in interface Hyphenationpublic char getHyphen()
getHyphen in interface HyphenationHyphenator.getHyphen()public String toString()
HyphenationtoString in interface HyphenationtoString in class ObjectCopyright © 2001–2016 mmm-Team. All rights reserved.