Class StringWrap

  • All Implemented Interfaces:

    @API(since = "5.5", status = API.Status.EXPERIMENTAL) 
    public class StringWrap
    
                        

    Wraps text in such a way so the lines do not exceed given maximum length.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final int minWrap
      public final int maxWrap
    • Constructor Summary

      Constructors 
      Constructor Description
      StringWrap(int minWrap, int maxWrap) Creates string wrapper instance.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      int getMinWrap()
      int getMaxWrap()
      String wrap(String input, String delimiter) Wraps given input text accoding to
      • Methods inherited from class java.lang.Object

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

      • StringWrap

        StringWrap(int minWrap, int maxWrap)
        Creates string wrapper instance.
        Parameters:
        minWrap - minimal word length for the wrap
        maxWrap - maximum word length for the wrap
    • Method Detail

      • wrap

         String wrap(String input, String delimiter)

        Wraps given input text accoding to

        Parameters:
        input - input text
        delimiter - delimiter when inserting soft wraps
        Returns:

        modified text with added soft wraps, or input if wraps are not needed