Package net.morimekta.console.chr
Interface Char
-
- All Superinterfaces:
java.lang.Comparable<Char>
,net.morimekta.util.Numeric
,net.morimekta.util.Stringable
public interface Char extends net.morimekta.util.Stringable, net.morimekta.util.Numeric, java.lang.Comparable<Char>
General interface implemented by character-like classes. A char can represent an actual character (Unicode), or a control sequence (Control, Color) that can alter the look or behaviour of the console the application runs in.
-
-
Field Summary
Fields Modifier and Type Field Description static char
ABR
Abort - [Control c]static char
BEL
Bell.static char
BS
Backspace: Not used on Linuxstatic char
CR
Carriage Return.static char
DEL
DEL, A.K.A.static char
EOF
Abort - [Control d]static char
ESC
Escape.static char
FF
Form Feed.static char
FS
File Separator.static char
GS
Group Separator.static char
LF
Line Feed (newline).static char
NUL
Null.static char
RS
Record Separator.static char
TAB
Horizontal Tab.static char
US
Unit Separator.static char
VT
Vertical Tab.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
asInteger()
Unicode codepoint representing this character.int
length()
Number of utf-16 characters that this character takes up if enclosed in a java string.int
printableWidth()
The number of character spaces taken up by this symbol.
-
-
-
Field Detail
-
NUL
static final char NUL
Null.- See Also:
- Constant Field Values
-
ABR
static final char ABR
Abort - [Control c]- See Also:
- Constant Field Values
-
EOF
static final char EOF
Abort - [Control d]- See Also:
- Constant Field Values
-
BEL
static final char BEL
Bell.- See Also:
- Constant Field Values
-
BS
static final char BS
Backspace: Not used on Linux- See Also:
- Constant Field Values
-
TAB
static final char TAB
Horizontal Tab.- See Also:
- Constant Field Values
-
LF
static final char LF
Line Feed (newline).- See Also:
- Constant Field Values
-
VT
static final char VT
Vertical Tab.- See Also:
- Constant Field Values
-
FF
static final char FF
Form Feed.- See Also:
- Constant Field Values
-
CR
static final char CR
Carriage Return.- See Also:
- Constant Field Values
-
ESC
static final char ESC
Escape.- See Also:
- Constant Field Values
-
FS
static final char FS
File Separator.- See Also:
- Constant Field Values
-
GS
static final char GS
Group Separator.- See Also:
- Constant Field Values
-
RS
static final char RS
Record Separator.- See Also:
- Constant Field Values
-
US
static final char US
Unit Separator.- See Also:
- Constant Field Values
-
DEL
static final char DEL
DEL, A.K.A. "Backspace" Note: This is a Linux keyboard weirdness, that backspace key returns DEL (\0177), not BS (\010), which is the ASCII control char made specifically to represent that key...- See Also:
- Constant Field Values
-
-
Method Detail
-
asInteger
int asInteger()
Unicode codepoint representing this character.- Specified by:
asInteger
in interfacenet.morimekta.util.Numeric
- Returns:
- The 31 bit unsigned unicode code-point, or -1 if not representing a single unicode character.
-
printableWidth
int printableWidth()
The number of character spaces taken up by this symbol. Usually 1, but 0 for control sequences, control characters, and 2 for wide symbols like CJK characters.- Returns:
- The printable width of the character.
-
length
int length()
Number of utf-16 characters that this character takes up if enclosed in a java string.- Returns:
- The char count of the character.
-
-