Class AsciiString

  • All Implemented Interfaces:
    java.lang.Comparable<AsciiString>

    public class AsciiString
    extends java.lang.Object
    implements java.lang.Comparable<AsciiString>
    Simple string implemented as a byte[] array. Each character's higher 8 bits are truncated and only the lower 8 bits are stored. AsciiString is mutable for efficiency reasons, but the chars array should never be changed !
    Since:
    3.5
    Author:
    Bela Ban
    • Field Detail

      • val

        protected final byte[] val
    • Constructor Detail

      • AsciiString

        public AsciiString()
      • AsciiString

        public AsciiString​(java.lang.String str)
      • AsciiString

        public AsciiString​(byte[] val)
      • AsciiString

        public AsciiString​(int length)
    • Method Detail

      • chars

        public byte[] chars()
      • length

        public int length()
      • compareTo

        public int compareTo​(AsciiString str)
        Specified by:
        compareTo in interface java.lang.Comparable<AsciiString>
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • equals

        public boolean equals​(byte[] other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object