public class ArrayCharSequence extends Object implements CharSequence, Serializable
CharSequence
backed by a char[]
.Constructor and Description |
---|
ArrayCharSequence(char[] buf)
Creates a new
ArrayCharSequence with the specified char[] ,
with the char sequence range as 0 to buf.length . |
ArrayCharSequence(char[] buf,
int count)
Creates a new
ArrayCharSequence with the specified char[] ,
with the char sequence range as 0 to count . |
ArrayCharSequence(char[] buf,
int offset,
int count)
Creates a new
ArrayCharSequence with the specified char[] ,
with the char sequence range as offset to count . |
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
boolean |
equals(Object obj) |
int |
hashCode() |
int |
length() |
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
chars, codePoints
public ArrayCharSequence(char[] buf)
ArrayCharSequence
with the specified char[]
,
with the char sequence range as 0
to buf.length
.buf
- The char[]
.NullPointerException
- If buf
is null.public ArrayCharSequence(char[] buf, int count)
ArrayCharSequence
with the specified char[]
,
with the char sequence range as 0
to count
.buf
- The char[]
.count
- The count.IndexOutOfBoundsException
- If count
is negative, or
buf.length
is less than count
.NullPointerException
- If buf
is null.public ArrayCharSequence(char[] buf, int offset, int count)
ArrayCharSequence
with the specified char[]
,
with the char sequence range as offset
to count
.buf
- The char[]
.offset
- The offset.count
- The count.IndexOutOfBoundsException
- If offset
is negative,
count
is negative, or buf.length
is less than
offset + count
.NullPointerException
- If buf
is null.public char charAt(int index)
charAt
in interface CharSequence
public int length()
length
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public String toString()
toString
in interface CharSequence
toString
in class Object
Copyright © 2020 LibJ. All rights reserved.