Class WhitespaceCollapser


  • final class WhitespaceCollapser
    extends java.lang.Object

    Collapses whitespace of an RtfContainer that contains RtfText elements.

    This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean lastEndSpace  
      private static java.lang.String SPACE  
    • Constructor Summary

      Constructors 
      Constructor Description
      WhitespaceCollapser​(RtfContainer c)
      Remove extra whitespace in RtfText elements that are inside container.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getLastEndSpace()  
      private java.lang.String processString​(java.lang.String txt)
      process one String
      private void processString​(RtfString txt)
      process one RtfString from our container
      private void processText​(RtfText txt)
      process one RtfText from our container
      • Methods inherited from class java.lang.Object

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

      • lastEndSpace

        private boolean lastEndSpace
    • Constructor Detail

      • WhitespaceCollapser

        WhitespaceCollapser​(RtfContainer c)
        Remove extra whitespace in RtfText elements that are inside container.
        Parameters:
        c - the container
    • Method Detail

      • getLastEndSpace

        public boolean getLastEndSpace()
        Returns:
        last end space
      • processText

        private void processText​(RtfText txt)
        process one RtfText from our container
      • processString

        private void processString​(RtfString txt)
        process one RtfString from our container
      • processString

        private java.lang.String processString​(java.lang.String txt)
        process one String