net.sf.vex.dom
Class TextWrapper

java.lang.Object
  |
  +--net.sf.vex.dom.TextWrapper

public class TextWrapper
extends java.lang.Object

Wraps text to a given width.


Constructor Summary
TextWrapper()
          Class constructor.
 
Method Summary
 void add(java.lang.String s)
          Adds text to the list of things to be wrapped.
 void addNoSplit(java.lang.String s)
          Adds text to the list of things to be wrapped.
 void clear()
          Clears any added text.
 java.lang.String[] wrap(int width)
          Wraps the text into the given width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextWrapper

public TextWrapper()
Class constructor.

Method Detail

add

public void add(java.lang.String s)
Adds text to the list of things to be wrapped.

Parameters:
s - Text to be added.

addNoSplit

public void addNoSplit(java.lang.String s)
Adds text to the list of things to be wrapped. The given text will be treated as a single unit and will not be split across lines.

Parameters:
s - Text to be added.

clear

public void clear()
Clears any added text.


wrap

public java.lang.String[] wrap(int width)
Wraps the text into the given width. The text is only broken at spaces, meaning the returned lines will not necessarily fit within width.

Parameters:
width -