Class TextHyphenator

  • All Implemented Interfaces:
    Hyphenator

    public class TextHyphenator
    extends AbstractHyphenator
    This Hyphenator adds soft hyphens (­) where hyphens are can be placed. HTML-Tags are not hyphenated.
    • Method Detail

      • appendWord

        protected void appendWord​(StringBuilder result,
                                  StringBuilder wordBuffer)
        Appends the content of wordBuffer to result and truncates the wordBuffer. The implementing method may modify the content.
        Specified by:
        appendWord in class AbstractHyphenator
        Parameters:
        result - output buffer
        wordBuffer - buffered word
      • appendTag

        protected void appendTag​(StringBuilder result,
                                 StringBuilder wordBuffer)
        Appends the content of wordBuffer to result and truncates the wordBuffer. The implementing method should not modify the content.
        Specified by:
        appendTag in class AbstractHyphenator
        Parameters:
        result - output buffer
        wordBuffer - buffered word
      • appendHyphenatedWord

        protected void appendHyphenatedWord​(StringBuilder result,
                                            StringBuilder wordBuffer,
                                            String hyphen)
        Appends the content of wordBuffer to result and truncates the wordBuffer.
        Specified by:
        appendHyphenatedWord in class AbstractHyphenator
        Parameters:
        result - output buffer
        wordBuffer - buffered word
        hyphen - hyphen String eg. "-" or "­"
      • getSplittedChars

        public String getSplittedChars​(String hyphen)
        Parameters:
        hyphen -
        Returns: