Package org.apache.lucene.analysis.util
Class OpenStringBuilder
- java.lang.Object
-
- org.apache.lucene.analysis.util.OpenStringBuilder
-
- All Implemented Interfaces:
java.lang.Appendable
,java.lang.CharSequence
public class OpenStringBuilder extends java.lang.Object implements java.lang.Appendable, java.lang.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 java.lang.Appendable
append(char c)
java.lang.Appendable
append(java.lang.CharSequence csq)
java.lang.Appendable
append(java.lang.CharSequence csq, int start, int end)
int
capacity()
char
charAt(int index)
void
flush()
char[]
getArray()
int
length()
void
reserve(int num)
void
reset()
void
set(char[] arr, int end)
void
setCharAt(int index, char ch)
void
setLength(int len)
int
size()
java.lang.CharSequence
subSequence(int start, int end)
char[]
toCharArray()
java.lang.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(java.lang.String s)
void
write(OpenStringBuilder arr)
-
-
-
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 interfacejava.lang.CharSequence
-
capacity
public int capacity()
-
append
public java.lang.Appendable append(java.lang.CharSequence csq)
- Specified by:
append
in interfacejava.lang.Appendable
-
append
public java.lang.Appendable append(java.lang.CharSequence csq, int start, int end)
- Specified by:
append
in interfacejava.lang.Appendable
-
append
public java.lang.Appendable append(char c)
- Specified by:
append
in interfacejava.lang.Appendable
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfacejava.lang.CharSequence
-
setCharAt
public void setCharAt(int index, char ch)
-
subSequence
public java.lang.CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfacejava.lang.CharSequence
-
unsafeWrite
public void unsafeWrite(char b)
-
unsafeWrite
public void unsafeWrite(int b)
-
unsafeWrite
public void unsafeWrite(char[] b, int off, 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(java.lang.String s)
-
flush
public void flush()
-
reset
public final void reset()
-
toCharArray
public char[] toCharArray()
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfacejava.lang.CharSequence
- Overrides:
toString
in classjava.lang.Object
-
-