Interface Char

  • All Superinterfaces:
    java.lang.Comparable<Char>, net.morimekta.util.Numeric, net.morimekta.util.Stringable
    All Known Implementing Classes:
    Color, Control, Unicode

    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 Linux
      static 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.
      • Methods inherited from interface java.lang.Comparable

        compareTo
      • Methods inherited from interface net.morimekta.util.Stringable

        asString
    • Method Detail

      • asInteger

        int asInteger()
        Unicode codepoint representing this character.
        Specified by:
        asInteger in interface net.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.