public final class CharacterWalker extends Object
A character set determines a 32 bit value for each character. The values from 0 to 64K are reserved for their Unicode interpretation. Otherwise the value has no particular significance. But values can be used to build up another sequence with a CharacterBuffer.
CharacterSet, CharacterBuffer| Constructor and Description |
|---|
CharacterWalker(CharacterSet charSet, byte[] bytes, int offset, int count)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasMoreCharacters()
Reports whether there are more bytes waiting to be converted.
|
int |
nextCharacter()
Returns the next character in the sequence and advances the CharacterWalker over it.
|
public CharacterWalker(CharacterSet charSet, byte[] bytes, int offset, int count)
charSet - the CharacterSet to be used in interpreting the bytes.bytes - the byte array containing the data to be interpreted.offset - the index in bytes of the first byte to be interpreted.count - the number of bytes to be interpreted.public int nextCharacter()
throws NoSuchElementException
NoSuchElementException - if the walker has already returned the last character or the sequence is ill-formed. That is, the next bytes are somehow not allowed in the given representationpublic boolean hasMoreCharacters()