|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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_CHARS if necessary.
| Field Summary | |
|---|---|
char[] |
chars
|
static char[] |
EMPTY_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(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 |
char |
charAt(int index)
|
boolean |
charsEquals(CharsRef other)
|
CharsRef |
clone()
|
int |
compareTo(CharsRef other)
Signed int order comparison |
void |
copyChars(char[] otherChars,
int otherOffset,
int otherLength)
Copies the given array into this CharsRef starting at offset 0 |
void |
copyChars(CharsRef other)
Copies the given CharsRef referenced content into this instance
starting at offset 0. |
static CharsRef |
deepCopyOf(CharsRef other)
Creates a new CharsRef that points to a copy of the chars from other |
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 static final char[] EMPTY_CHARS
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
| Method Detail |
|---|
public CharsRef clone()
clone in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectpublic boolean charsEquals(CharsRef other)
public int compareTo(CharsRef other)
compareTo in interface Comparable<CharsRef>public void copyChars(CharsRef other)
CharsRef referenced content into this instance
starting at offset 0.
other - the CharsRef to copypublic void grow(int newLength)
public void copyChars(char[] otherChars,
int otherOffset,
int otherLength)
public void append(char[] otherChars,
int otherOffset,
int otherLength)
public String toString()
toString in interface CharSequencetoString in class Objectpublic int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequence
public CharSequence subSequence(int start,
int end)
subSequence in interface CharSequencepublic static Comparator<CharsRef> getUTF16SortedAsUTF8Comparator()
public static CharsRef deepCopyOf(CharsRef other)
other
The returned CharsRef will have a length of other.length and an offset of zero.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||