Interface CharStream

All Known Implementing Classes:
StringCharStream

public interface CharStream
This interface produces a sequence of chars. These can either be "read", which means basically the same as Reader.read(); or they can be "peeked", which means that the next character is returned, but not consumed, i.e. the next call to read() or peek() will return that character again.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    A special value for the values returned by peek() and peekRead(char) indicating end-of-input.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    eoi()
     
    int
    Returns the next character on this stream but does not consume it.
    boolean
    peek(char c)
    Returns whether the character stream is not at end-of-input and the next character on this stream equals the given character.
    int
    peek(String chars)
    Checks whether the next character on this stream equals any of the characters of the given String.
    boolean
    peekRead(char c)
    If the next character on this stream equals the given character, it is consumed.
    int
    If the next character on this stream is in the given String, it is consumed.
    char
    Consumes and returns the next character on this stream.
    void
    read(char c)
    Consumes the next character on this stream and verifies that it equals the given character.
    int
    read(String chars)
    Consumes the nect character and verifies that it matches one of the characters of the given String.