public class CharArraySegment extends Segment implements CharSequence
Implements CharSequence
interface by leveraging Segment
class.
Note: Since Java 1.6, Segment
implements CharSequence
interface.
DONE
Constructor and Description |
---|
CharArraySegment()
Zero-argument default constructor.
|
CharArraySegment(char[] array,
int offset,
int count)
Constructs a
Segment from the array by selecting a range. |
CharArraySegment(String s)
Constructs a
Segment from the given string. |
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
int |
length() |
CharSequence |
subSequence(int start,
int end) |
clone, current, first, getBeginIndex, getEndIndex, getIndex, isPartialReturn, last, next, previous, setIndex, setPartialReturn, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
toString
public CharArraySegment()
public CharArraySegment(char[] array, int offset, int count)
Segment
from the array
by selecting a range.array
- offset
- count
- public char charAt(int index)
charAt
in interface CharSequence
charAt
in class Segment
public int length()
length
in interface CharSequence
length
in class Segment
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
subSequence
in class Segment
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.