Class WrappingStringBuilder


  • public class WrappingStringBuilder
    extends java.lang.Object
    Implements a string buffer that separates words by "," and wraps lines at a given margin.
    • Constructor Summary

      Constructors 
      Constructor Description
      WrappingStringBuilder​(int maxLineLength)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(int value)
      Appends an integer value.
      void append​(java.lang.String str)
      Appends a word.
      java.lang.String toString()
      Returns the concatenated words as a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • WrappingStringBuilder

        public WrappingStringBuilder​(int maxLineLength)
        Creates a new instance.
        Parameters:
        maxLineLength - the maximum line length
    • Method Detail

      • append

        public void append​(java.lang.String str)
        Appends a word.
        Parameters:
        str - the word to append
      • append

        public void append​(int value)
        Appends an integer value.
        Parameters:
        value - the integer value to append
      • toString

        public java.lang.String toString()
        Returns the concatenated words as a string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the concatenated words