Class AppendableCharSequence

  • All Implemented Interfaces:
    java.lang.Appendable, java.lang.CharSequence

    public final class AppendableCharSequence
    extends java.lang.Object
    implements java.lang.CharSequence, java.lang.Appendable
    • Constructor Detail

      • AppendableCharSequence

        public AppendableCharSequence​(int length)
    • Method Detail

      • setLength

        public void setLength​(int length)
      • length

        public int length()
        Specified by:
        length in interface java.lang.CharSequence
      • charAt

        public char charAt​(int index)
        Specified by:
        charAt in interface java.lang.CharSequence
      • charAtUnsafe

        public char charAtUnsafe​(int index)
        Access a value in this CharSequence. This method is considered unsafe as index values are assumed to be legitimate. Only underlying array bounds checking is done.
        Parameters:
        index - The index to access the underlying array at.
        Returns:
        The value at index.
      • subSequence

        public AppendableCharSequence subSequence​(int start,
                                                  int end)
        Specified by:
        subSequence in interface java.lang.CharSequence
      • append

        public AppendableCharSequence append​(char c)
        Specified by:
        append in interface java.lang.Appendable
      • append

        public AppendableCharSequence append​(java.lang.CharSequence csq)
        Specified by:
        append in interface java.lang.Appendable
      • append

        public AppendableCharSequence append​(java.lang.CharSequence csq,
                                             int start,
                                             int end)
        Specified by:
        append in interface java.lang.Appendable
      • reset

        public void reset()
        Reset the AppendableCharSequence. Be aware this will only reset the current internal position and not shrink the internal char array.
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class java.lang.Object
      • substring

        public java.lang.String substring​(int start,
                                          int end)
        Create a new String from the given start to end.
      • subStringUnsafe

        public java.lang.String subStringUnsafe​(int start,
                                                int end)
        Create a new String from the given start to end. This method is considered unsafe as index values are assumed to be legitimate. Only underlying array bounds checking is done.