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.
-
-
Constructor Summary
Constructors Constructor Description OpenStringBuilder()
OpenStringBuilder(char[] arr, int len)
OpenStringBuilder(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods 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)
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(String s)
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
-
-
-
-
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 interfaceCharSequence
-
capacity
public int capacity()
-
append
public Appendable append(CharSequence csq)
- Specified by:
append
in interfaceAppendable
-
append
public Appendable append(CharSequence csq, int start, int end)
- Specified by:
append
in interfaceAppendable
-
append
public Appendable append(char c)
- Specified by:
append
in interfaceAppendable
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
setCharAt
public void setCharAt(int index, char ch)
-
subSequence
public CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
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 interfaceCharSequence
- Overrides:
toString
in classObject
-
-