|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--prog.utils.HTMLWordWrap
Like WordWrap
, this converts
a long String into a multi-line String that fits within a
specified line length (or default of 80 characters per
line). It ignores any HTML tags in the
input String and replaces any newline characters with
<BR>. It inserts a <BR> at the start of every new line
resulting from wrapping.
Constructor Summary | |
HTMLWordWrap()
Sets the column width to 80. |
|
HTMLWordWrap(int lineLength)
Sets the maximum number of characters in a line to lineLength. |
Method Summary | |
java.lang.String |
format(java.lang.String str)
Inserts line breaks and in str so that there are no morecharacters per line than the default (80) or the than the line length set via constructor. |
java.lang.String |
format(java.lang.String str,
int lineLength)
Inserts line breaks and in str so that there are no more characters per line than lineLength. |
static void |
main(java.lang.String[] args)
|
void |
setLineLength(int lineLength)
Sets the line length for word wrap. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HTMLWordWrap()
public HTMLWordWrap(int lineLength)
lineLength
- Number of characters to allow in
a line before splitting.Method Detail |
public java.lang.String format(java.lang.String str)
public java.lang.String format(java.lang.String str, int lineLength)
public void setLineLength(int lineLength)
public static void main(java.lang.String[] args)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |