|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.text.base.DefaultLineWrapper.TextSegment
protected static class DefaultLineWrapper.TextSegment
This class represents a segment of some text. It acts as
an event when iterating the text.
It is classified by a type and caches a potential
hyphenation for performance reasons.
| Field Summary | |
|---|---|
private int |
endIndex
|
private Hyphenation |
hyphenatedWord
|
private Hyphenator |
hyphenator
|
private int |
startIndex
|
private String |
text
|
private DefaultLineWrapper.TextSegmentType |
type
|
| Constructor Summary | |
|---|---|
protected |
DefaultLineWrapper.TextSegment(String text,
Hyphenator hyphenator)
The constructor. |
| Method Summary | |
|---|---|
int |
getEndIndex()
This method gets the index immediately after the last character of this DefaultLineWrapper.TextSegment. |
Hyphenation |
getHyphenatedWord()
This method gets the Hyphenation if this DefaultLineWrapper.TextSegment has
the type DefaultLineWrapper.TextSegmentType.WORD. |
int |
getLength()
This method gets the length of this DefaultLineWrapper.TextSegment. |
int |
getStartIndex()
This method gets the start index of this DefaultLineWrapper.TextSegment. |
String |
getText()
This method gets the full text containing this segment. |
DefaultLineWrapper.TextSegmentType |
getType()
This method determines if this DefaultLineWrapper.TextSegment represents a word. |
void |
initialize(int start,
int end,
DefaultLineWrapper.TextSegmentType textType)
This method resets and initializes this object. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final String text
getText()private final Hyphenator hyphenator
getHyphenatedWord()private int startIndex
getStartIndex()private int endIndex
getEndIndex()private DefaultLineWrapper.TextSegmentType type
getType()private Hyphenation hyphenatedWord
getHyphenatedWord()| Constructor Detail |
|---|
protected DefaultLineWrapper.TextSegment(String text,
Hyphenator hyphenator)
text - is the getText().hyphenator - is the Hyphenation used for
getHyphenatedWord().| Method Detail |
|---|
public int getLength()
DefaultLineWrapper.TextSegment.
endIndex -
startIndex.
public void initialize(int start,
int end,
DefaultLineWrapper.TextSegmentType textType)
start - is the start-index.end - is the end-index.textType - is the type.public int getStartIndex()
DefaultLineWrapper.TextSegment.
DefaultLineWrapper.TextSegment.public int getEndIndex()
DefaultLineWrapper.TextSegment.
DefaultLineWrapper.TextSegment.public String getText()
public DefaultLineWrapper.TextSegmentType getType()
DefaultLineWrapper.TextSegment represents a word.
true if segment is word, false
otherwise (special characters, etc.)getHyphenatedWord()public Hyphenation getHyphenatedWord()
Hyphenation if this DefaultLineWrapper.TextSegment has
the type DefaultLineWrapper.TextSegmentType.WORD. The
Hyphenation will be build lazy on the first call of this method.
Hyphenation or null if this is no word.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||