OpenStringBuilder (Lucene 10.5.1 common API)
Description: declaration: package: org.apache.lucene.analysis.util, class: OpenStringBuilder

Package org.apache.lucene.analysis.util

# Class OpenStringBuilder

java.lang.Object
org.apache.lucene.analysis.util.OpenStringBuilder

All Implemented Interfaces:
  `Appendable`, `CharSequence`

public class OpenStringBuilder extends Object implements Appendable, CharSequence
A StringBuilder that allows one to access the array.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected char[]`
  `buf`
  `protected int`
  `len`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `OpenStringBuilder()`
  `OpenStringBuilder(char[] arr, int len)`
  `OpenStringBuilder(int size)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Appendable`
  `append(char c)`
  `Appendable`
  `append(CharSequence csq)`
  `Appendable`
  `append(CharSequence csq, int start, int end)`
  `int`
  `capacity()`
  `char`
  `charAt(int index)`
  `void`
  `flush()`
  `char[]`
  `getArray()`
  `int`
  `length()`
  `void`
  `reserve(int num)`
  `final void`
  `reset()`
  `protected void`
  `resize(int len)`
  `void`
  `set(char[] arr, int end)`
  `void`
  `setCharAt(int index, char ch)`
  `void`
  `setLength(int len)`
  `int`
  `size()`
  `CharSequence`
  `subSequence(int start, int end)`
  `char[]`
  `toCharArray()`
  `String`
  `toString()`
  `void`
  `unsafeWrite(char b)`
  `void`
  `unsafeWrite(char[] b, int off, int len)`
  `void`
  `unsafeWrite(int b)`
  `void`
  `write(char b)`
  `final void`
  `write(char[] b)`
  `void`
  `write(char[] b, int off, int len)`
  `void`
  `write(int b)`
  `void`
  `write(String s)`
  `final void`
  `write(OpenStringBuilder arr)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.lang.CharSequence

  `chars, codePoints, isEmpty`

- ## Field Details

  - ### buf

    protected char[] buf

  - ### len

    protected int len

- ## Constructor Details

  - ### OpenStringBuilder

    public OpenStringBuilder()

  - ### OpenStringBuilder

    public OpenStringBuilder(int size)

  - ### OpenStringBuilder

    public OpenStringBuilder(char[] arr, int len)

- ## Method Details

  - ### setLength

    public void setLength(int len)

  - ### set

    public void set(char[] arr, int end)

  - ### getArray

    public char[] getArray()

  - ### size

    public int size()

  - ### length

    public int length()
    Specified by:
      `length` in interface `CharSequence`

  - ### capacity

    public int capacity()

  - ### append

    public Appendable append(CharSequence csq)
    Specified by:
      `append` in interface `Appendable`

  - ### append

    public Appendable append(CharSequence csq, int start, int end)
    Specified by:
      `append` in interface `Appendable`

  - ### append

    public Appendable append(char c)
    Specified by:
      `append` in interface `Appendable`

  - ### charAt

    public char charAt(int index)
    Specified by:
      `charAt` in interface `CharSequence`

  - ### setCharAt

    public void setCharAt(int index, char ch)

  - ### subSequence

    public CharSequence subSequence(int start, int end)
    Specified by:
      `subSequence` in interface `CharSequence`

  - ### unsafeWrite

    public void unsafeWrite(char b)

  - ### unsafeWrite

    public void unsafeWrite(int b)

  - ### unsafeWrite

    public void unsafeWrite(char[] b, int off, int len)

  - ### resize

    protected void resize(int len)

  - ### reserve

    public void reserve(int num)

  - ### write

    public void write(char b)

  - ### write

    public void write(int b)

  - ### write

    public final void write(char[] b)

  - ### write

    public void write(char[] b, int off, int len)

  - ### write

    public final void write(OpenStringBuilder arr)

  - ### write

    public void write(String s)

  - ### flush

    public void flush()

  - ### reset

    public final void reset()

  - ### toCharArray

    public char[] toCharArray()

  - ### toString

    public String toString()
    Specified by:
      `toString` in interface `CharSequence`
    Overrides:
      `toString` in class `Object`