public final class CharsRef extends java.lang.Object implements java.lang.Comparable<CharsRef>, java.lang.CharSequence, java.lang.Cloneable
chars
member should never be null; use
EMPTY_CHARS
if necessary.Modifier and Type | Field and Description |
---|---|
char[] |
chars |
static char[] |
EMPTY_CHARS |
int |
length |
int |
offset |
Constructor and Description |
---|
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(java.lang.String string)
Creates a new
CharsRef initialized with the given Strings character
array |
Modifier and Type | Method and Description |
---|---|
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(java.lang.Object other) |
static java.util.Comparator<CharsRef> |
getUTF16SortedAsUTF8Comparator() |
void |
grow(int newLength)
Used to grow the reference array.
|
int |
hashCode() |
int |
length() |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toString() |
public static final char[] EMPTY_CHARS
public char[] chars
public int offset
public int length
public CharsRef()
CharsRef
initialized an empty array zero-lengthpublic CharsRef(int capacity)
CharsRef
initialized with an array of the given
capacitypublic CharsRef(char[] chars, int offset, int length)
CharsRef
initialized with the given array, offset and
lengthpublic CharsRef(java.lang.String string)
CharsRef
initialized with the given Strings character
arraypublic CharsRef clone()
clone
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean charsEquals(CharsRef other)
public int compareTo(CharsRef other)
compareTo
in interface java.lang.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 java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
public int length()
length
in interface java.lang.CharSequence
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public static java.util.Comparator<CharsRef> getUTF16SortedAsUTF8Comparator()
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.