net.sf.mmm.util.text.base
Class AbstractLineWrapper

java.lang.Object
  extended by net.sf.mmm.util.component.base.AbstractComponent
      extended by net.sf.mmm.util.component.base.AbstractLoggableComponent
          extended by net.sf.mmm.util.text.base.AbstractLineWrapper
All Implemented Interfaces:
LineWrapper
Direct Known Subclasses:
DefaultLineWrapper

public abstract class AbstractLineWrapper
extends AbstractLoggableComponent
implements LineWrapper

This is the abstract base-implementation of the LineWrapper interface.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Constructor Summary
AbstractLineWrapper()
          The constructor.
 
Method Summary
 int wrap(Appendable appendable, TextTableInfo tableInfo, String columnText, TextColumnInfo columnInfo)
          This method appends the given text to the appendable.
 int wrap(Appendable appendable, TextTableInfo tableInfo, String column1Text, TextColumnInfo column1Info, String column2Text, TextColumnInfo column2Info)
          This method is like LineWrapper.wrap(Appendable, TextTableInfo, String, TextColumnInfo) but for a two-column layout.
 int wrap(Appendable appendable, TextTableInfo tableInfo, String column1Text, TextColumnInfo column1Info, String column2Text, TextColumnInfo column2Info, String column3Text, TextColumnInfo column3Info)
          This method is like LineWrapper.wrap(Appendable, TextTableInfo, String, TextColumnInfo) but for a three-column layout.
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent
doInitialize, getLogger, setLogger
 
Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent
doInitialized, getInitializationState, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.mmm.util.text.api.LineWrapper
wrap
 

Constructor Detail

AbstractLineWrapper

public AbstractLineWrapper()
The constructor.

Method Detail

wrap

public int wrap(Appendable appendable,
                TextTableInfo tableInfo,
                String columnText,
                TextColumnInfo columnInfo)
This method appends the given text to the appendable. If the text is longer than the number of characters left in the current line, the text is wrapped. This means the current line is filled with parts of the text, a newline is added and the next line is filled with the same procedure until the entire text is processed. The last line is NOT terminated with a newline but ends with the last character of the text.

Specified by:
wrap in interface LineWrapper
Parameters:
appendable - is the target where to append to.
tableInfo - is the TextTableInfo for the general layout.
columnText - is the text to append. The text may contain newline characters to indicate a line-break is forced at those positions.
columnInfo - holds the configuration like width, alignment, indent, etc.
Returns:
the number of lines that have been appended excluding the first line. In other words the number of line separators that have been appended.

wrap

public int wrap(Appendable appendable,
                TextTableInfo tableInfo,
                String column1Text,
                TextColumnInfo column1Info,
                String column2Text,
                TextColumnInfo column2Info)
This method is like LineWrapper.wrap(Appendable, TextTableInfo, String, TextColumnInfo) but for a two-column layout.

Specified by:
wrap in interface LineWrapper
Parameters:
appendable - is the target where to append to.
tableInfo - is the TextTableInfo for the general layout.
column1Text - is the text for the first column.
column1Info - is the TextColumnInfo of the first column.
column2Text - is the text for the second column.
column2Info - is the TextColumnInfo of the second column.
Returns:
the number of lines that have been appended excluding the first line. In other words the number of line separators that have been appended.
See Also:
LineWrapper.wrap(Appendable, TextTableInfo, TextColumn[])

wrap

public int wrap(Appendable appendable,
                TextTableInfo tableInfo,
                String column1Text,
                TextColumnInfo column1Info,
                String column2Text,
                TextColumnInfo column2Info,
                String column3Text,
                TextColumnInfo column3Info)
This method is like LineWrapper.wrap(Appendable, TextTableInfo, String, TextColumnInfo) but for a three-column layout.

Specified by:
wrap in interface LineWrapper
Parameters:
appendable - is the target where to append to.
tableInfo - is the TextTableInfo for the general layout.
column1Text - is the text for the first column.
column1Info - is the TextColumnInfo of the first column.
column2Text - is the text for the second column.
column2Info - is the TextColumnInfo of the second column.
column3Text - is the text for the third column.
column3Info - is the TextColumnInfo of the third column.
Returns:
the number of lines that have been appended excluding the first line. In other words the number of line separators that have been appended.
See Also:
LineWrapper.wrap(Appendable, TextTableInfo, TextColumn[])


Copyright © 2001-2010 mmm-Team. All Rights Reserved.