Package net.morimekta.console.chr
Class Unicode
- java.lang.Object
-
- net.morimekta.console.chr.Unicode
-
- All Implemented Interfaces:
java.lang.Comparable<Char>
,Char
,net.morimekta.util.Numeric
,net.morimekta.util.Stringable
public class Unicode extends java.lang.Object implements Char
Unicode character representation. It represent the full 31-but unicode code point, and will expand to the 2 surrogate paired string if necessary.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
asInteger()
Unicode codepoint representing this character.java.lang.String
asString()
int
compareTo(Char o)
boolean
equals(java.lang.Object o)
int
hashCode()
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.java.lang.String
toString()
-
-
-
Field Detail
-
NBSP
public static final Unicode NBSP
No-break space.
-
-
Method Detail
-
asInteger
public int asInteger()
Description copied from interface:Char
Unicode codepoint representing this character.
-
asString
public java.lang.String asString()
- Specified by:
asString
in interfacenet.morimekta.util.Stringable
-
printableWidth
public int printableWidth()
Description copied from interface:Char
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.- Specified by:
printableWidth
in interfaceChar
- Returns:
- The printable width of the character.
-
length
public int length()
Description copied from interface:Char
Number of utf-16 characters that this character takes up if enclosed in a java string.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-