Class IStringBuffer

    • Constructor Detail

      • IStringBuffer

        public IStringBuffer()
        create a buffer with a default length 16
      • IStringBuffer

        public IStringBuffer​(int length)
        create a buffer with a specified length
        Parameters:
        length -
      • IStringBuffer

        public IStringBuffer​(String str)
        create a buffer with a specified string
        Parameters:
        str -
    • Method Detail

      • append

        public IStringBuffer append​(String str)
        append a string to the buffer
        Parameters:
        str - string to append to
      • append

        public IStringBuffer append​(char[] chars,
                                    int start,
                                    int length)
        append parts of the chars to the buffer
        Parameters:
        chars -
        start - the start index
        length - length of chars to append to
      • append

        public IStringBuffer append​(char[] chars,
                                    int start)
        append the rest of the chars to the buffer
        Parameters:
        chars -
        start - the start index
        Returns:
        IStringBuffer
      • append

        public IStringBuffer append​(char[] chars)
        append some chars to the buffer
        Parameters:
        chars -
      • append

        public IStringBuffer append​(char c)
        append a char to the buffer
        Parameters:
        c - the char to append to
      • append

        public IStringBuffer append​(boolean bool)
        append a boolean value
        Parameters:
        bool -
      • append

        public IStringBuffer append​(short shortv)
        append a short value
        Parameters:
        shortv -
      • append

        public IStringBuffer append​(int intv)
        append a int value
        Parameters:
        intv -
      • append

        public IStringBuffer append​(long longv)
        append a long value
        Parameters:
        longv -
      • append

        public IStringBuffer append​(float floatv)
        append a float value
        Parameters:
        floatv -
      • append

        public IStringBuffer append​(double doublev)
        append a double value
        Parameters:
        doublev -
      • length

        public int length()
        return the length of the buffer
        Returns:
        int the length of the buffer
      • setLength

        public int setLength​(int length)
        set the length of the buffer actually it just override the count and the actual buffer has nothing changed
        Parameters:
        length -
      • charAt

        public char charAt​(int idx)
        get the char at a specified position in the buffer
      • last

        public char last()
        always return the last char
        Returns:
        char
      • first

        public char first()
        always return the first char
        Returns:
        char
      • deleteCharAt

        public IStringBuffer deleteCharAt​(int idx)
        delete the char at the specified position
      • set

        public void set​(int idx,
                        char chr)
        set the char at the specified index
        Parameters:
        idx -
        chr -
      • buffer

        public char[] buffer()
        return the chars of the buffer
        Returns:
        char[]
      • clear

        public IStringBuffer clear()
        clear the buffer by reset the count to 0