CharacterArrayCharacterIteratorpublic final class CharacterArrayCharacterIterator extends Object implements CharacterIteratorEncapsulates char[] as CharacterIterator |
Fields Summary |
---|
private final char[] | srcencapsulated | private final int | offoffset in the char array | private final int | lenused portion of the array |
Constructors Summary |
---|
public CharacterArrayCharacterIterator(char[] src, int off, int len)
this.src = src;
this.off = off;
this.len = len;
|
Methods Summary |
---|
public char | charAt(int pos)
return src[off + pos];
| public boolean | isEnd(int pos)
return (pos >= len);
| public java.lang.String | substring(int beginIndex, int endIndex)
if (endIndex > len) {
throw new IndexOutOfBoundsException("endIndex=" + endIndex
+ "; sequence size=" + len);
}
if (beginIndex < 0 || beginIndex > endIndex) {
throw new IndexOutOfBoundsException("beginIndex=" + beginIndex
+ "; endIndex=" + endIndex);
}
return new String(src, off + beginIndex, endIndex - beginIndex);
| public java.lang.String | substring(int beginIndex)
return substring(beginIndex, len);
|
|