|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.text.base.HyphenationImpl
public class HyphenationImpl
This is the implementation of the Hyphenation interface.
| Field Summary | |
|---|---|
private char |
hyphen
|
private int[] |
hyphenationPoints
|
private String |
word
|
| Constructor Summary | |
|---|---|
HyphenationImpl(String hyphenatedWord)
The constructor. |
|
HyphenationImpl(String hyphenatedWord,
char hyphen)
The constructor. |
|
HyphenationImpl(String word,
char hyphen,
int[] hyphenationPoints)
The constructor. |
|
| Method Summary | |
|---|---|
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. un-avail-able). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final String word
getWord()private final int[] hyphenationPoints
getHyphenation(int)private final char hyphen
getHyphen()| Constructor Detail |
|---|
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.| Method Detail |
|---|
public int getHyphenationCount()
getHyphenationCount in interface Hyphenation0 for "I" or
"egg" or 1 for "im-pact").public int getHyphenation(int hyphenationIndex)
getHyphenation 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)
hyphenation
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()
getWord in interface Hyphenationpublic char getHyphen()
getHyphen in interface HyphenationHyphenator.getHyphen()public String toString()
toString in interface HyphenationtoString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||