Class MutableCharArray

    • Constructor Detail

      • MutableCharArray

        public MutableCharArray()
        Creates an empty MutableCharArray.
      • MutableCharArray

        public MutableCharArray​(char[] buffer)
        Resets the internal buffer to use the provided argument.
        See Also:
        reset(char[])
      • MutableCharArray

        public MutableCharArray​(char[] buffer,
                                int start,
                                int length)
        Resets the internal buffer to use the provided argument.
        See Also:
        reset(char[])
    • Method Detail

      • reset

        public void reset​(CharSequence seq)
        Resets internal buffers in this object to represent another character sequence. See class header notes for side-effects on equals(Object) and hashCode().
      • reset

        public void reset​(char[] buffer)
        Resets internal buffers in this object to point to another character buffer. See class header notes for side-effects on equals(Object) and hashCode().
      • reset

        public void reset​(char[] buffer,
                          int start,
                          int length)
        Resets internal buffers in this object to point to another character buffer. See class header notes for side-effects on equals(Object) and hashCode().
      • getBuffer

        public char[] getBuffer()
        Returns:
        Returns the internal buffer currently used to store the content of this char sequence.
      • getStart

        public int getStart()
        Returns:
        the offset at which the data currently starts in the buffer.
        See Also:
        getBuffer(), length
      • charAt

        public final char charAt​(int index)
        Specified by:
        charAt in interface CharSequence
      • hashCode

        public int hashCode()
        See comments in the header of this class.
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object other)
        See comments in the header of this class.
        Overrides:
        equals in class Object
      • hashCode

        public static final int hashCode​(char[] buffer,
                                         int start,
                                         int length)
        Calculates a hash code for a given portion of the character buffer. The returned value is identical to what be returned from hashCode() if a wrapper MutableCharArray were created.
      • toArray

        public char[] toArray()