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, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittoStringpublic 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 CharSequencecharAt in class Segmentpublic int length()
length in interface CharSequencelength in class Segmentpublic CharSequence subSequence(int start, int end)
subSequence in interface CharSequencesubSequence in class SegmentCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.