Class TruncateTextBuilderImpl

    • Constructor Detail

      • TruncateTextBuilderImpl

        public TruncateTextBuilderImpl​()
    • Method Detail

      • getTruncateTextMode

        public TruncateTextMode getTruncateTextMode​()
        Retrieves the truncate text mode from the truncate text mode property.
        Specified by:
        getTruncateTextMode in interface TruncateTextBuilder
        Returns:
        The truncate text mode stored by the truncate text mode property.
      • setTruncateTextMode

        public void setTruncateTextMode​(TruncateTextMode aTruncateTextMode)
        Sets the truncate text mode for the truncate text mode property.
        Specified by:
        setTruncateTextMode in interface TruncateTextBuilder
        Parameters:
        aTruncateTextMode - The truncate text mode to be stored by the truncate text mode property.
      • getTruncateChars

        public char[] getTruncateChars​()
        Retrieves the truncate chars from the truncate chars property.
        Specified by:
        getTruncateChars in interface TruncateTextBuilder
        Returns:
        The truncate chars stored by the truncate chars property.
      • setTruncateChars

        public void setTruncateChars​(char... aStripChars)
        Sets the truncate chars for the truncate chars property.
        Specified by:
        setTruncateChars in interface TruncateTextBuilder
        Parameters:
        aStripChars - The truncate chars to be stored by the text align mode property.
      • toStrip

        protected static java.lang.String toStrip​(java.lang.String aText,
                                                  char[] aChars,
                                                  TruncateTextMode aTruncateTextMode)
        To strip.
        Parameters:
        aText - the text
        aChars - the chars
        aTruncateTextMode - the truncate text mode
        Returns:
        the string
      • doStripLeft

        protected static void doStripLeft​(java.lang.StringBuffer aStringBuffer,
                                          char aChar)
        Removes all leading chars identical with specified char. E.g. if str=AAABBBAAABBB and ch=A the returned String will be BBBAAABBB.
        Parameters:
        aStringBuffer - StringBuffer to modify.
        aChar - Char to remove.
      • toStripLeft

        protected static java.lang.String toStripLeft​(java.lang.String aText,
                                                      char[] aChars)
        Returns a new String without leading chars.
        Parameters:
        aText - The text to be stripped.
        aChars - the chars
        Returns:
        The stripped text.
      • doStripRight

        protected static void doStripRight​(java.lang.StringBuffer aStringBuffer,
                                           char aChar)
        Removes all rear chars identical with specified char ch. E.g. if str=AAABBBAAABBB and ch=B str will become AAABBBAAA.
        Parameters:
        aStringBuffer - StringBuffer to modify.
        aChar - Char to remove.
      • doStrip

        protected static void doStrip​(java.lang.StringBuffer aStringBuffer,
                                      char aChar)
        Removes all leading and trailing chars identical with specified char ch. E.g. if str=BAABBBAAABBB and ch=B str will become AABBBAAA.
        Parameters:
        aStringBuffer - StringBuffer to modify.
        aChar - Char to remove.
      • toStripRight

        protected static java.lang.String toStripRight​(java.lang.String aText,
                                                       char[] aChars)
        Returns a new String without trailing chars.
        Parameters:
        aText - Description is currently not available!
        aChars - the chars
        Returns:
        Description is currently not available!
      • toStrip

        protected static java.lang.String toStrip​(java.lang.String aText,
                                                  char[] aChars)
        Returns a new String without leading nor trailing chars.
        Parameters:
        aText - The text to be stripped.
        aChars - the chars
        Returns:
        The stripped text.
      • getText

        public java.lang.String[] getText​()
        Retrieves the text from the text property.
        Specified by:
        getText in interface TextAccessor
        Returns:
        The text stored by the text property.
      • setText

        public void setText​(java.lang.String... aText)
        Sets the text for the text property.
        Specified by:
        setText in interface TextAccessor.TextMutator
        Parameters:
        aText - The text to be stored by the text property.
      • withText

        public B withText​(java.lang.String... aText)
        With text.
        Specified by:
        withText in interface Text<B extends Text<B>>
        Specified by:
        withText in interface TextAccessor.TextBuilder<B extends Text<B>>
        Parameters:
        aText - the text
        Returns:
        the b
      • withText

        public B withText​(java.util.Collection<java.lang.String> aText)
        With text.
        Specified by:
        withText in interface TextAccessor.TextBuilder<B extends Text<B>>
        Parameters:
        aText - the text
        Returns:
        the b
      • toString

        public java.lang.String toString​()
        The String being build by the builder upon the settings of the attributes. In case more then one line has been set as input and the functionality of the builder is applied to each line in separate, then this method returns all of them lines concatenated with a line break between each of them (implementation depended).
        Specified by:
        toString in interface TextAccessor.TextProvider
        Overrides:
        toString in class java.lang.Object
        Returns:
        The according resulting String