public class CharArray extends Object implements CharSequence
CharSequence implementation.
set(char[], int, int)
buffer(), offset() and length()
| Constructor and Description |
|---|
CharArray(char[] buff)
Allocates a new
CharArray so that it represents the sequence of
characters currently contained in the character array argument. |
CharArray(char[] buff,
int offset,
int length)
Allocates a new
CharArray that contains characters from a subarray
of the character array argument. |
| Modifier and Type | Method and Description |
|---|---|
CharArrayReader |
asReader()
creates a new
CharArrayReader to read contents of this chararray |
char[] |
buffer()
returns the char buffer used by this instance
|
char |
charAt(int index) |
int |
length() |
int |
offset()
returns the index of first character in char buffer
|
void |
set(char[] buff,
int offset,
int length)
replaces the internal char buffer with the given char array.
|
CharSequence |
subSequence(int start,
int end) |
char[] |
toCharArray(boolean clone) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchars, codePointspublic CharArray(char[] buff)
CharArray so that it represents the sequence of
characters currently contained in the character array argument. The
contents of the character array are not copied;buff - value of the chararraypublic CharArray(char[] buff,
int offset,
int length)
CharArray that contains characters from a subarray
of the character array argument. The offset argument is the
index of the first character of the subarray and the length
argument specifies the length of the subarray. The contents of the
subarray are not copied;buff - Array that is the source of charactersoffset - The initial offsetlength - The lengthIndexOutOfBoundsException - If the offset and length arguments index
characters outside the bounds of the buff arraypublic void set(char[] buff,
int offset,
int length)
buff - Array that is the source of charactersoffset - The initial offsetlength - The lengthpublic char[] buffer()
public int offset()
public int length()
length in interface CharSequencepublic char[] toCharArray(boolean clone)
public char charAt(int index)
charAt in interface CharSequencepublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencepublic CharArrayReader asReader()
CharArrayReader to read contents of this chararraypublic String toString()
toString in interface CharSequencetoString in class ObjectCopyright © 2021. All rights reserved.