|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.CharsRef
public final class CharsRef
Represents char[], as a slice (offset + length) into an existing char[].
The chars
member should never be null; use
EMPTY_ARRAY
if necessary.
Field Summary | |
---|---|
char[] |
chars
|
int |
length
|
int |
offset
|
Constructor Summary | |
---|---|
CharsRef()
Creates a new CharsRef initialized an empty array zero-length |
|
CharsRef(char[] chars,
int offset,
int length)
Creates a new CharsRef initialized with the given array, offset and
length |
|
CharsRef(CharsRef other)
Creates a new CharsRef and copies the contents of the source into
the new instance. |
|
CharsRef(int capacity)
Creates a new CharsRef initialized with an array of the given
capacity |
|
CharsRef(String string)
Creates a new CharsRef initialized with the given Strings character
array |
Method Summary | |
---|---|
void |
append(char[] otherChars,
int otherOffset,
int otherLength)
Appends the given array to this CharsRef starting at the current offset |
char |
charAt(int index)
|
boolean |
charsEquals(CharsRef other)
|
Object |
clone()
|
int |
compareTo(CharsRef other)
Signed int order comparison |
void |
copy(char[] otherChars,
int otherOffset,
int otherLength)
Copies the given array into this CharsRef starting at offset 0 |
void |
copy(CharsRef other)
Copies the given CharsRef referenced content into this instance
starting at offset 0. |
boolean |
equals(Object other)
|
static Comparator<CharsRef> |
getUTF16SortedAsUTF8Comparator()
|
void |
grow(int newLength)
|
int |
hashCode()
|
int |
length()
|
CharSequence |
subSequence(int start,
int end)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public char[] chars
public int offset
public int length
Constructor Detail |
---|
public CharsRef()
CharsRef
initialized an empty array zero-length
public CharsRef(int capacity)
CharsRef
initialized with an array of the given
capacity
public CharsRef(char[] chars, int offset, int length)
CharsRef
initialized with the given array, offset and
length
public CharsRef(String string)
CharsRef
initialized with the given Strings character
array
public CharsRef(CharsRef other)
CharsRef
and copies the contents of the source into
the new instance.
copy(CharsRef)
Method Detail |
---|
public Object clone()
clone
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
public boolean charsEquals(CharsRef other)
public int compareTo(CharsRef other)
compareTo
in interface Comparable<CharsRef>
public void copy(CharsRef other)
CharsRef
referenced content into this instance
starting at offset 0.
other
- the CharsRef
to copypublic void grow(int newLength)
public void copy(char[] otherChars, int otherOffset, int otherLength)
public void append(char[] otherChars, int otherOffset, int otherLength)
public String toString()
toString
in interface CharSequence
toString
in class Object
public int length()
length
in interface CharSequence
public char charAt(int index)
charAt
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public static Comparator<CharsRef> getUTF16SortedAsUTF8Comparator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |