|
|||||||||
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
The contents of the CharsRef. |
static char[] |
EMPTY_CHARS
An empty character array for convenience |
int |
length
Length of used characters. |
int |
offset
Offset of first valid character. |
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. |
void |
copyChars(CharsRef other)
Copies the given CharsRef referenced content into this instance. |
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()
Deprecated. This comparator is only a transition mechanism |
void |
grow(int newLength)
Used to grow the reference array. |
int |
hashCode()
|
boolean |
isValid()
Performs internal consistency checks. |
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
null
.
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 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 copyChars(CharsRef other)
CharsRef
referenced content into this instance.
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 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
@Deprecated public 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.
public boolean isValid()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |