public class CharsRefBuilder extends Object implements Appendable
CharsRef
instances.Constructor and Description |
---|
CharsRefBuilder()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
CharsRefBuilder |
append(char c) |
void |
append(char[] otherChars,
int otherOffset,
int otherLength)
Appends the given array to this CharsRef
|
CharsRefBuilder |
append(CharSequence csq) |
CharsRefBuilder |
append(CharSequence csq,
int start,
int end) |
char |
charAt(int offset)
Return the char at the given offset.
|
char[] |
chars()
Return a reference to the chars of this builder.
|
void |
clear()
Reset this builder to the empty state.
|
void |
copyChars(char[] otherChars,
int otherOffset,
int otherLength)
Copies the given array into this instance.
|
void |
copyChars(CharsRef other)
Copies the given
CharsRef referenced content into this instance. |
void |
copyUTF8Bytes(byte[] bytes,
int offset,
int length)
Copy the provided bytes, interpreted as UTF-8 bytes.
|
void |
copyUTF8Bytes(BytesRef bytes)
Copy the provided bytes, interpreted as UTF-8 bytes.
|
boolean |
equals(Object obj) |
CharsRef |
get()
Return a
CharsRef that points to the internal content of this
builder. |
void |
grow(int newLength)
Used to grow the reference array.
|
int |
hashCode() |
int |
length()
Return the number of chars in this buffer.
|
void |
setCharAt(int offset,
char b)
Set a char.
|
void |
setLength(int length)
Set the length.
|
CharsRef |
toCharsRef()
Build a new
CharsRef that has the same content as this builder. |
String |
toString() |
public char[] chars()
public int length()
public void setLength(int length)
public char charAt(int offset)
public void setCharAt(int offset, char b)
public void clear()
public CharsRefBuilder append(CharSequence csq)
append
in interface Appendable
public CharsRefBuilder append(CharSequence csq, int start, int end)
append
in interface Appendable
public CharsRefBuilder append(char c)
append
in interface Appendable
public void copyChars(CharsRef other)
CharsRef
referenced content into this instance.public void grow(int newLength)
public void copyUTF8Bytes(byte[] bytes, int offset, int length)
public void copyUTF8Bytes(BytesRef bytes)
public void copyChars(char[] otherChars, int otherOffset, int otherLength)
public void append(char[] otherChars, int otherOffset, int otherLength)
public CharsRef get()
CharsRef
that points to the internal content of this
builder. Any update to the content of this builder might invalidate
the provided ref
and vice-versa.public CharsRef toCharsRef()
CharsRef
that has the same content as this builder.Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.