Class CharUtils
java.lang.Object
org.springframework.shell.test.jediterm.terminal.util.CharUtils
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
static final char
static final char
static byte[]
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendBuf
(StringBuilder sb, char[] bs, int begin, int length) static CharUtils.CharacterType
appendChar
(StringBuilder sb, CharUtils.CharacterType last, char c) static int
countDoubleWidthCharacters
(char[] buf, int start, int length, boolean ambiguousIsDWC) static String
getNonControlCharacters
(int maxChars, char[] buf, int offset, int charsLength) static int
getTextLengthDoubleWidthAware
(char[] buffer, int start, int length, boolean ambiguousIsDWC) Computes text length as sum of characters length, treating double-width(full-width) characters as 2, normal-width(half-width) as 1 (Read http://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)static CharBuffer
static boolean
isDoubleWidthCharacter
(int c, boolean ambiguousIsDWC) static byte[]
makeCode
(int... bytesAsInt) static String
toHumanReadableText
(String escapeSequence)
-
Field Details
-
NUL_CHAR
public static final char NUL_CHAR- See Also:
-
EMPTY_CHAR
public static final char EMPTY_CHAR- See Also:
-
DWC
public static final char DWC- See Also:
-
VT102_RESPONSE
public static byte[] VT102_RESPONSE
-
-
Method Details
-
getNonControlCharacters
-
countDoubleWidthCharacters
public static int countDoubleWidthCharacters(char[] buf, int start, int length, boolean ambiguousIsDWC) -
appendChar
public static CharUtils.CharacterType appendChar(StringBuilder sb, CharUtils.CharacterType last, char c) -
appendBuf
-
makeCode
public static byte[] makeCode(int... bytesAsInt) -
getTextLengthDoubleWidthAware
public static int getTextLengthDoubleWidthAware(char[] buffer, int start, int length, boolean ambiguousIsDWC) Computes text length as sum of characters length, treating double-width(full-width) characters as 2, normal-width(half-width) as 1 (Read http://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) -
isDoubleWidthCharacter
public static boolean isDoubleWidthCharacter(int c, boolean ambiguousIsDWC) -
heavyDecCompatibleBuffer
-
toHumanReadableText
-