|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.text.api.TextColumn
net.sf.mmm.util.text.base.DefaultLineWrapper.ColumnState
protected static class DefaultLineWrapper.ColumnState
This class represents the state of a text-column. It contains the
text of the column and its
metadata. Further it holds the
current text-index and acts as some sort
of iterator of
text-segments.
| Field Summary | |
|---|---|
private BreakIterator |
breakIterator
|
private int |
breakIteratorIndex
|
private DefaultLineWrapper.TextSegment |
currentSegment
|
private Hyphenator |
hyphenator
The Hyphenator to use. |
private boolean |
indent
|
private DefaultLineWrapper.TextSegment |
nextSegment
|
private int |
segmentIndex
|
private int |
subsequentNewlineCount
|
private int |
textIndex
|
private int |
width
|
| Constructor Summary | |
|---|---|
DefaultLineWrapper.ColumnState(String text,
TextColumnInfo columnInfo,
HyphenatorBuilder hyphenatorBuilder)
The constructor. |
|
| Method Summary | |
|---|---|
private static DefaultLineWrapper.TextSegmentType |
getCharacterType(char c)
This method gets the DefaultLineWrapper.TextSegmentType corresponding to the given
character. |
DefaultLineWrapper.TextSegment |
getCurrentSegment()
This method gets the current DefaultLineWrapper.TextSegment. |
DefaultLineWrapper.TextSegment |
getNextSegment()
This method gets the next DefaultLineWrapper.TextSegment after the
current. |
int |
getSubsequentNewlineCount()
This method gets the current number of subsequent newlines. |
int |
getTextIndex()
|
int |
getWidth()
This method gets the physical width. |
boolean |
isComplete()
This method determines if this column is complete (all text is appended). |
boolean |
isIndent()
|
private DefaultLineWrapper.TextSegment |
next(DefaultLineWrapper.TextSegment textSegment)
This method initializes the given DefaultLineWrapper.TextSegment with the next segment-data
from the text. |
boolean |
proceedTextSegment()
This method steps on to the next DefaultLineWrapper.TextSegment. |
void |
setIndent(boolean indent)
|
void |
setTextIndex(int textIndex)
|
void |
setWidth(int width)
|
| Methods inherited from class net.sf.mmm.util.text.api.TextColumn |
|---|
getColumnInfo, getText |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final Hyphenator hyphenator
Hyphenator to use.
private final BreakIterator breakIterator
#next(TextSegment)private int breakIteratorIndex
#next(TextSegment)private int segmentIndex
#next(TextSegment)private int textIndex
getTextIndex()private int width
getWidth()private boolean indent
isIndent()private DefaultLineWrapper.TextSegment currentSegment
getCurrentSegment()private DefaultLineWrapper.TextSegment nextSegment
getNextSegment()private int subsequentNewlineCount
getSubsequentNewlineCount()| Constructor Detail |
|---|
public DefaultLineWrapper.ColumnState(String text,
TextColumnInfo columnInfo,
HyphenatorBuilder hyphenatorBuilder)
text - is the text.columnInfo - is the column-info.hyphenatorBuilder - is the HyphenatorBuilder.| Method Detail |
|---|
public DefaultLineWrapper.TextSegment getCurrentSegment()
DefaultLineWrapper.TextSegment. Initially this is the
first DefaultLineWrapper.TextSegment available.
DefaultLineWrapper.TextSegment or null if all
DefaultLineWrapper.TextSegments are proceeded.proceedTextSegment()public DefaultLineWrapper.TextSegment getNextSegment()
DefaultLineWrapper.TextSegment after the
current. This method exists for lookahead
decisions.
DefaultLineWrapper.TextSegment or null if NOT
available (current segment is the
last segment or also null).public int getSubsequentNewlineCount()
current segment is a
DefaultLineWrapper.TextSegmentType.NEWLINE, this method will return the number of
DefaultLineWrapper.TextSegmentType.NEWLINE segments (including the current) that
occurred since the last other segment. Otherwise it will always return
0.
DefaultLineWrapper.TextSegmentType.NEWLINE segments including the
current segment or 0 if
the current segment is no
DefaultLineWrapper.TextSegmentType.NEWLINE.public boolean proceedTextSegment()
DefaultLineWrapper.TextSegment. The
current segment is set to the
next segment and the next segment is set to the next determined
segment.
true if a new current
segment is available, false if the entire text has
been proceeded.private DefaultLineWrapper.TextSegment next(DefaultLineWrapper.TextSegment textSegment)
initializes the given DefaultLineWrapper.TextSegment with the next segment-data
from the text.
textSegment - a previous DefaultLineWrapper.TextSegment that can be reused.
DefaultLineWrapper.TextSegment with the next segment-data or
null if the text is completed.private static DefaultLineWrapper.TextSegmentType getCharacterType(char c)
DefaultLineWrapper.TextSegmentType corresponding to the given
character.
c - is the character to check.
DefaultLineWrapper.TextSegmentType.public int getTextIndex()
public void setTextIndex(int textIndex)
textIndex - is the textIndex to setpublic boolean isIndent()
public void setIndent(boolean indent)
indent - is the indent to setpublic int getWidth()
width. A
value of TextColumnInfo.WIDTH_AUTO_ADJUST is replaced with a
physical value.
width.public void setWidth(int width)
width - is the width to setpublic boolean isComplete()
text is appended).
true if complete, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||