Class CJKTextWidthCounter

  • All Implemented Interfaces:
    TextWidthCounter

    public class CJKTextWidthCounter
    extends java.lang.Object
    implements TextWidthCounter

    CJK aware TextWidthCounter implementation.

    This class uses East Asian Width information of Unicode and counts 2 for Wide, Full and Ambiguous characters.

    The application code should not use this class directly.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int width​(java.lang.String text)
      Counts given text consumes how many fixed character width.
      • Methods inherited from class java.lang.Object

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

      • CJKTextWidthCounter

        public CJKTextWidthCounter()
    • Method Detail

      • width

        public int width​(java.lang.String text)
        Description copied from interface: TextWidthCounter
        Counts given text consumes how many fixed character width.
        Specified by:
        width in interface TextWidthCounter
        Parameters:
        text - The text to inspect.
        Returns:
        The computed value.