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 and Description
    --- | ---
    `protected char[]` | `buf`
    `protected int` | `len`

  - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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)`
    `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)`
    `void` | `write(char[] b)`
    `void` | `write(char[] b, int off, int len)`
    `void` | `write(int b)`
    `void` | `write(OpenStringBuilder arr)`
    `void` | `write(String s)`

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

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

- - ### Field Detail

    - #### buf

          protected char[] buf

    - #### len

          protected int len

  - ### Constructor Detail

    - #### OpenStringBuilder

          public OpenStringBuilder()

    - #### OpenStringBuilder

          public OpenStringBuilder(int size)

    - #### OpenStringBuilder

          public OpenStringBuilder(char[] arr,
                           int len)

  - ### Method Detail

    - #### 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`

Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.