Module net.sourceforge.argparse4j
Class CJKTextWidthCounter
- java.lang.Object
-
- net.sourceforge.argparse4j.helper.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
CJKTextWidthCounter.CpRange
Range is [first, last)private static class
CJKTextWidthCounter.CpRangeCmp
private static class
CJKTextWidthCounter.EastAsianWidth
-
Field Summary
Fields Modifier and Type Field Description private static CJKTextWidthCounter.CpRangeCmp
cpRangeCmp_
private static CJKTextWidthCounter.CpRange[]
ranges_
Compiled using wfarange.py.
-
Constructor Summary
Constructors Constructor Description CJKTextWidthCounter()
-
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.
-
-
-
Field Detail
-
cpRangeCmp_
private static final CJKTextWidthCounter.CpRangeCmp cpRangeCmp_
-
ranges_
private static final CJKTextWidthCounter.CpRange[] ranges_
Compiled using wfarange.py. # EastAsianWidth-10.0.0.txt # Date: Wed Aug 2 00:29:26 PDT 2017
-
-
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 interfaceTextWidthCounter
- Parameters:
text
- The text to inspect.- Returns:
- The computed value.
-
-