Class NameAbbreviator.PatternAbbreviatorFragment

  • Enclosing class:
    NameAbbreviator

    private static class NameAbbreviator.PatternAbbreviatorFragment
    extends java.lang.Object
    Fragment of an pattern abbreviator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int charCount
      Count of initial characters of element to output.
      private char ellipsis
      Character used to represent dropped characters.
    • Constructor Summary

      Constructors 
      Constructor Description
      PatternAbbreviatorFragment​(int charCount, char ellipsis)
      Creates a PatternAbbreviatorFragment.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int abbreviate​(java.lang.StringBuilder buf, int startPos)
      Abbreviate element of name.
      • Methods inherited from class java.lang.Object

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

      • charCount

        private final int charCount
        Count of initial characters of element to output.
      • ellipsis

        private final char ellipsis
        Character used to represent dropped characters. '\0' indicates no representation of dropped characters.
    • Constructor Detail

      • PatternAbbreviatorFragment

        public PatternAbbreviatorFragment​(int charCount,
                                          char ellipsis)
        Creates a PatternAbbreviatorFragment.
        Parameters:
        charCount - number of initial characters to preserve.
        ellipsis - character to represent elimination of characters, '\0' if no ellipsis is desired.
    • Method Detail

      • abbreviate

        public int abbreviate​(java.lang.StringBuilder buf,
                              int startPos)
        Abbreviate element of name.
        Parameters:
        buf - buffer to receive element.
        startPos - starting index of name element.
        Returns:
        starting index of next element.