Class Ascii

java.lang.Object
com.google.common.base.Ascii

@GwtCompatible @Deprecated(since="2022-12-01") public final class Ascii extends Object
Deprecated.
The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
Static methods pertaining to ASCII characters (those in the range of values 0x00 through 0x7F), and to strings containing such characters.

ASCII utilities also exist in other classes of this package:

  • Charsets.US_ASCII specifies the Charset of ASCII characters.
  • CharMatcher.ASCII matches ASCII characters and provides text processing methods which operate only on the ASCII characters of a string.
Since:
7.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte
    Deprecated.
    Acknowledge: A communication control character transmitted by a receiver as an affirmative response to a sender.
    static final byte
    Deprecated.
    Bell ('\a'): A character for use when there is a need to call for human attention.
    static final byte
    Deprecated.
    Backspace ('\b'): A format effector which controls the movement of the printing position one printing space backward on the same printing line.
    static final byte
    Deprecated.
    Cancel: A control character used to indicate that the data with which it is sent is in error or is to be disregarded.
    static final byte
    Deprecated.
    Carriage Return ('\r'): A format effector which controls the movement of the printing position to the first printing position on the same printing line.
    static final byte
    Deprecated.
    Device Control 1.
    static final byte
    Deprecated.
    Device Control 2.
    static final byte
    Deprecated.
    Device Control 3.
    static final byte
    Deprecated.
    Device Control 4.
    static final byte
    Deprecated.
    Delete: This character is used primarily to "erase" or "obliterate" erroneous or unwanted characters in perforated tape.
    static final byte
    Deprecated.
    Data Link Escape: A communication control character which will change the meaning of a limited number of contiguously following characters.
    static final byte
    Deprecated.
    End of Medium: A control character associated with the sent data which may be used to identify the physical end of the medium, or the end of the used, or wanted, portion of information recorded on a medium.
    static final byte
    Deprecated.
    Enquiry: A communication control character used in data communication systems as a request for a response from a remote station.
    static final byte
    Deprecated.
    End of Transmission: A communication control character used to indicate the conclusion of a transmission, which may have contained one or more texts and any associated headings.
    static final byte
    Deprecated.
    Escape: A control character intended to provide code extension (supplementary characters) in general information interchange.
    static final byte
    Deprecated.
    End of Transmission Block: A communication control character used to indicate the end of a block of data for communication purposes.
    static final byte
    Deprecated.
    End of Text: A communication control character used to terminate a sequence of characters started with STX and transmitted as an entity.
    static final byte
    Deprecated.
    Form Feed ('\f'): A format effector which controls the movement of the printing position to the first pre-determined printing line on the next form or page.
    static final byte
    Deprecated.
    File Separator: These four information separators may be used within data in optional fashion, except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then RS, and US is least inclusive.
    static final byte
    Deprecated.
    Group Separator: These four information separators may be used within data in optional fashion, except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then RS, and US is least inclusive.
    static final byte
    Deprecated.
    Horizontal Tabulation ('\t'): A format effector which controls the movement of the printing position to the next in a series of predetermined positions along the printing line.
    static final byte
    Deprecated.
    Line Feed ('\n'): A format effector which controls the movement of the printing position to the next printing line.
    static final char
    Deprecated.
    The maximum value of an ASCII character.
    static final char
    Deprecated.
    The minimum value of an ASCII character.
    static final byte
    Deprecated.
    Negative Acknowledge: A communication control character transmitted by a receiver as a negative response to the sender.
    static final byte
    Deprecated.
    Alternate name for LF.
    static final byte
    Deprecated.
    Null ('\0'): The all-zeros character which may serve to accomplish time fill and media fill.
    static final byte
    Deprecated.
    Record Separator: These four information separators may be used within data in optional fashion, except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then RS, and US is least inclusive.
    static final byte
    Deprecated.
    Shift In: A control character indicating that the code combinations which follow shall be interpreted according to the standard code table.
    static final byte
    Deprecated.
    Shift Out: A control character indicating that the code combinations which follow shall be interpreted as outside of the character set of the standard code table until a Shift In character is reached.
    static final byte
    Deprecated.
    Start of Heading: A communication control character used at the beginning of a sequence of characters which constitute a machine-sensible address or routing information.
    static final byte
    Deprecated.
    Space: A normally non-printing graphic character used to separate words.
    static final byte
    Deprecated.
    Alternate name for SP.
    static final byte
    Deprecated.
    Start of Text: A communication control character which precedes a sequence of characters that is to be treated as an entity and entirely transmitted through to the ultimate destination.
    static final byte
    Deprecated.
    Substitute: A character that may be substituted for a character which is determined to be invalid or in error.
    static final byte
    Deprecated.
    Synchronous Idle: A communication control character used by a synchronous transmission system in the absence of any other character to provide a signal from which synchronism may be achieved or retained.
    static final byte
    Deprecated.
    Unit Separator: These four information separators may be used within data in optional fashion, except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then RS, and US is least inclusive.
    static final byte
    Deprecated.
    Vertical Tabulation ('\v'): A format effector which controls the movement of the printing position to the next in a series of predetermined printing lines.
    static final byte
    Deprecated.
    Transmission off.
    static final byte
    Deprecated.
    Transmission On: Although originally defined as DC1, this ASCII control character is now better known as the XON code used for software flow control in serial communications.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isLowerCase(char c)
    Deprecated.
    Indicates whether c is one of the twenty-six lowercase ASCII alphabetic characters between 'a' and 'z' inclusive.
    static boolean
    isUpperCase(char c)
    Deprecated.
    Indicates whether c is one of the twenty-six uppercase ASCII alphabetic characters between 'A' and 'Z' inclusive.
    static char
    toLowerCase(char c)
    Deprecated.
    If the argument is an uppercase ASCII character returns the lowercase equivalent.
    static String
    Deprecated.
    Returns a copy of the input character sequence in which all uppercase ASCII characters have been converted to lowercase.
    static String
    Deprecated.
    Returns a copy of the input string in which all uppercase ASCII characters have been converted to lowercase.
    static char
    toUpperCase(char c)
    Deprecated.
    If the argument is a lowercase ASCII character returns the uppercase equivalent.
    static String
    Deprecated.
    Returns a copy of the input character sequence in which all lowercase ASCII characters have been converted to uppercase.
    static String
    Deprecated.
    Returns a copy of the input string in which all lowercase ASCII characters have been converted to uppercase.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NUL

      public static final byte NUL
      Deprecated.
      Null ('\0'): The all-zeros character which may serve to accomplish time fill and media fill. Normally used as a C string terminator.

      Although RFC 20 names this as "Null", note that it is distinct from the C/C++ "NULL" pointer.

      Since:
      8.0
      See Also:
    • SOH

      public static final byte SOH
      Deprecated.
      Start of Heading: A communication control character used at the beginning of a sequence of characters which constitute a machine-sensible address or routing information. Such a sequence is referred to as the "heading." An STX character has the effect of terminating a heading.
      Since:
      8.0
      See Also:
    • STX

      public static final byte STX
      Deprecated.
      Start of Text: A communication control character which precedes a sequence of characters that is to be treated as an entity and entirely transmitted through to the ultimate destination. Such a sequence is referred to as "text." STX may be used to terminate a sequence of characters started by SOH.
      Since:
      8.0
      See Also:
    • ETX

      public static final byte ETX
      Deprecated.
      End of Text: A communication control character used to terminate a sequence of characters started with STX and transmitted as an entity.
      Since:
      8.0
      See Also:
    • EOT

      public static final byte EOT
      Deprecated.
      End of Transmission: A communication control character used to indicate the conclusion of a transmission, which may have contained one or more texts and any associated headings.
      Since:
      8.0
      See Also:
    • ENQ

      public static final byte ENQ
      Deprecated.
      Enquiry: A communication control character used in data communication systems as a request for a response from a remote station. It may be used as a "Who Are You" (WRU) to obtain identification, or may be used to obtain station status, or both.
      Since:
      8.0
      See Also:
    • ACK

      public static final byte ACK
      Deprecated.
      Acknowledge: A communication control character transmitted by a receiver as an affirmative response to a sender.
      Since:
      8.0
      See Also:
    • BEL

      public static final byte BEL
      Deprecated.
      Bell ('\a'): A character for use when there is a need to call for human attention. It may control alarm or attention devices.
      Since:
      8.0
      See Also:
    • BS

      public static final byte BS
      Deprecated.
      Backspace ('\b'): A format effector which controls the movement of the printing position one printing space backward on the same printing line. (Applicable also to display devices.)
      Since:
      8.0
      See Also:
    • HT

      public static final byte HT
      Deprecated.
      Horizontal Tabulation ('\t'): A format effector which controls the movement of the printing position to the next in a series of predetermined positions along the printing line. (Applicable also to display devices and the skip function on punched cards.)
      Since:
      8.0
      See Also:
    • LF

      public static final byte LF
      Deprecated.
      Line Feed ('\n'): A format effector which controls the movement of the printing position to the next printing line. (Applicable also to display devices.) Where appropriate, this character may have the meaning "New Line" (NL), a format effector which controls the movement of the printing point to the first printing position on the next printing line. Use of this convention requires agreement between sender and recipient of data.
      Since:
      8.0
      See Also:
    • NL

      public static final byte NL
      Deprecated.
      Alternate name for LF. (LF is preferred.)
      Since:
      8.0
      See Also:
    • VT

      public static final byte VT
      Deprecated.
      Vertical Tabulation ('\v'): A format effector which controls the movement of the printing position to the next in a series of predetermined printing lines. (Applicable also to display devices.)
      Since:
      8.0
      See Also:
    • FF

      public static final byte FF
      Deprecated.
      Form Feed ('\f'): A format effector which controls the movement of the printing position to the first pre-determined printing line on the next form or page. (Applicable also to display devices.)
      Since:
      8.0
      See Also:
    • CR

      public static final byte CR
      Deprecated.
      Carriage Return ('\r'): A format effector which controls the movement of the printing position to the first printing position on the same printing line. (Applicable also to display devices.)
      Since:
      8.0
      See Also:
    • SO

      public static final byte SO
      Deprecated.
      Shift Out: A control character indicating that the code combinations which follow shall be interpreted as outside of the character set of the standard code table until a Shift In character is reached.
      Since:
      8.0
      See Also:
    • SI

      public static final byte SI
      Deprecated.
      Shift In: A control character indicating that the code combinations which follow shall be interpreted according to the standard code table.
      Since:
      8.0
      See Also:
    • DLE

      public static final byte DLE
      Deprecated.
      Data Link Escape: A communication control character which will change the meaning of a limited number of contiguously following characters. It is used exclusively to provide supplementary controls in data communication networks.
      Since:
      8.0
      See Also:
    • DC1

      public static final byte DC1
      Deprecated.
      Device Control 1. Characters for the control of ancillary devices associated with data processing or telecommunication systems, more especially switching devices "on" or "off." (If a single "stop" control is required to interrupt or turn off ancillary devices, DC4 is the preferred assignment.)
      Since:
      8.0
      See Also:
    • XON

      public static final byte XON
      Deprecated.
      Transmission On: Although originally defined as DC1, this ASCII control character is now better known as the XON code used for software flow control in serial communications. The main use is restarting the transmission after the communication has been stopped by the XOFF control code.
      Since:
      8.0
      See Also:
    • DC2

      public static final byte DC2
      Deprecated.
      Device Control 2. Characters for the control of ancillary devices associated with data processing or telecommunication systems, more especially switching devices "on" or "off." (If a single "stop" control is required to interrupt or turn off ancillary devices, DC4 is the preferred assignment.)
      Since:
      8.0
      See Also:
    • DC3

      public static final byte DC3
      Deprecated.
      Device Control 3. Characters for the control of ancillary devices associated with data processing or telecommunication systems, more especially switching devices "on" or "off." (If a single "stop" control is required to interrupt or turn off ancillary devices, DC4 is the preferred assignment.)
      Since:
      8.0
      See Also:
    • XOFF

      public static final byte XOFF
      Deprecated.
      Transmission off. See XON for explanation.
      Since:
      8.0
      See Also:
    • DC4

      public static final byte DC4
      Deprecated.
      Device Control 4. Characters for the control of ancillary devices associated with data processing or telecommunication systems, more especially switching devices "on" or "off." (If a single "stop" control is required to interrupt or turn off ancillary devices, DC4 is the preferred assignment.)
      Since:
      8.0
      See Also:
    • NAK

      public static final byte NAK
      Deprecated.
      Negative Acknowledge: A communication control character transmitted by a receiver as a negative response to the sender.
      Since:
      8.0
      See Also:
    • SYN

      public static final byte SYN
      Deprecated.
      Synchronous Idle: A communication control character used by a synchronous transmission system in the absence of any other character to provide a signal from which synchronism may be achieved or retained.
      Since:
      8.0
      See Also:
    • ETB

      public static final byte ETB
      Deprecated.
      End of Transmission Block: A communication control character used to indicate the end of a block of data for communication purposes. ETB is used for blocking data where the block structure is not necessarily related to the processing format.
      Since:
      8.0
      See Also:
    • CAN

      public static final byte CAN
      Deprecated.
      Cancel: A control character used to indicate that the data with which it is sent is in error or is to be disregarded.
      Since:
      8.0
      See Also:
    • EM

      public static final byte EM
      Deprecated.
      End of Medium: A control character associated with the sent data which may be used to identify the physical end of the medium, or the end of the used, or wanted, portion of information recorded on a medium. (The position of this character does not necessarily correspond to the physical end of the medium.)
      Since:
      8.0
      See Also:
    • SUB

      public static final byte SUB
      Deprecated.
      Substitute: A character that may be substituted for a character which is determined to be invalid or in error.
      Since:
      8.0
      See Also:
    • ESC

      public static final byte ESC
      Deprecated.
      Escape: A control character intended to provide code extension (supplementary characters) in general information interchange. The Escape character itself is a prefix affecting the interpretation of a limited number of contiguously following characters.
      Since:
      8.0
      See Also:
    • FS

      public static final byte FS
      Deprecated.
      File Separator: These four information separators may be used within data in optional fashion, except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then RS, and US is least inclusive. (The content and length of a File, Group, Record, or Unit are not specified.)
      Since:
      8.0
      See Also:
    • GS

      public static final byte GS
      Deprecated.
      Group Separator: These four information separators may be used within data in optional fashion, except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then RS, and US is least inclusive. (The content and length of a File, Group, Record, or Unit are not specified.)
      Since:
      8.0
      See Also:
    • RS

      public static final byte RS
      Deprecated.
      Record Separator: These four information separators may be used within data in optional fashion, except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then RS, and US is least inclusive. (The content and length of a File, Group, Record, or Unit are not specified.)
      Since:
      8.0
      See Also:
    • US

      public static final byte US
      Deprecated.
      Unit Separator: These four information separators may be used within data in optional fashion, except that their hierarchical relationship shall be: FS is the most inclusive, then GS, then RS, and US is least inclusive. (The content and length of a File, Group, Record, or Unit are not specified.)
      Since:
      8.0
      See Also:
    • SP

      public static final byte SP
      Deprecated.
      Space: A normally non-printing graphic character used to separate words. It is also a format effector which controls the movement of the printing position, one printing position forward. (Applicable also to display devices.)
      Since:
      8.0
      See Also:
    • SPACE

      public static final byte SPACE
      Deprecated.
      Alternate name for SP.
      Since:
      8.0
      See Also:
    • DEL

      public static final byte DEL
      Deprecated.
      Delete: This character is used primarily to "erase" or "obliterate" erroneous or unwanted characters in perforated tape.
      Since:
      8.0
      See Also:
    • MIN

      public static final char MIN
      Deprecated.
      The minimum value of an ASCII character.
      Since:
      9.0 (was type int before 12.0)
      See Also:
    • MAX

      public static final char MAX
      Deprecated.
      The maximum value of an ASCII character.
      Since:
      9.0 (was type int before 12.0)
      See Also:
  • Method Details

    • toLowerCase

      public static String toLowerCase(String string)
      Deprecated.
      Returns a copy of the input string in which all uppercase ASCII characters have been converted to lowercase. All other characters are copied without modification.
    • toLowerCase

      public static String toLowerCase(CharSequence chars)
      Deprecated.
      Returns a copy of the input character sequence in which all uppercase ASCII characters have been converted to lowercase. All other characters are copied without modification.
      Since:
      14.0
    • toLowerCase

      public static char toLowerCase(char c)
      Deprecated.
      If the argument is an uppercase ASCII character returns the lowercase equivalent. Otherwise returns the argument.
    • toUpperCase

      public static String toUpperCase(String string)
      Deprecated.
      Returns a copy of the input string in which all lowercase ASCII characters have been converted to uppercase. All other characters are copied without modification.
    • toUpperCase

      public static String toUpperCase(CharSequence chars)
      Deprecated.
      Returns a copy of the input character sequence in which all lowercase ASCII characters have been converted to uppercase. All other characters are copied without modification.
      Since:
      14.0
    • toUpperCase

      public static char toUpperCase(char c)
      Deprecated.
      If the argument is a lowercase ASCII character returns the uppercase equivalent. Otherwise returns the argument.
    • isLowerCase

      public static boolean isLowerCase(char c)
      Deprecated.
      Indicates whether c is one of the twenty-six lowercase ASCII alphabetic characters between 'a' and 'z' inclusive. All others (including non-ASCII characters) return false.
    • isUpperCase

      public static boolean isUpperCase(char c)
      Deprecated.
      Indicates whether c is one of the twenty-six uppercase ASCII alphabetic characters between 'A' and 'Z' inclusive. All others (including non-ASCII characters) return false.