class LineFormatter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
comment |
(package private) int |
length |
(package private) int |
maxLength |
(package private) int |
offset |
(package private) java.lang.String |
prefix |
private java.lang.StringBuilder |
sb |
Constructor and Description |
---|
LineFormatter(java.lang.String comment)
Creates a LineFormatter for the given comment
|
LineFormatter(java.lang.String comment,
int maxLength)
Creates a new LineFormatter for the given comment
|
LineFormatter(java.lang.String comment,
int maxLength,
java.lang.String prefix)
Creates a new LineFormatter for the given comment
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
hasMoreLines() |
private boolean |
isBreakable(char ch) |
private boolean |
isNewLine(char ch) |
private boolean |
isWhitespace(char ch) |
(package private) java.lang.String |
nextLine() |
(package private) void |
setPrefix(java.lang.String prefix)
Sets the prefix that should be appended to the beginning of
each line
|
java.lang.String comment
int maxLength
int offset
int length
java.lang.String prefix
private java.lang.StringBuilder sb
LineFormatter(java.lang.String comment)
comment
- the String to formatLineFormatter(java.lang.String comment, int maxLength)
comment
- the String to formatmaxLength
- the maximum number of characters per lineLineFormatter(java.lang.String comment, int maxLength, java.lang.String prefix)
comment
- the String to formatmaxLength
- the maximum number of characters per lineprefix
- a prefix to append to the beginning of each lineboolean hasMoreLines()
java.lang.String nextLine()
void setPrefix(java.lang.String prefix)
prefix
- the prefix for this LineFormatterprivate boolean isBreakable(char ch)
private boolean isWhitespace(char ch)
private boolean isNewLine(char ch)