Top Description Fields Constructors Methods
org.codehaus.janino.util.charstream

public Class StringCharStream

extends Object
implements CharStream
Class Inheritance
All Implemented Interfaces
org.codehaus.janino.util.charstream.CharStream
Imports
java.io.EOFException, .IOException

Reads from a String. Notice that none of the overridden methods throw IOException.

Field Summary

Modifier and TypeField and Description
private final String
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
public int
peek()

Implements org.codehaus.janino.util.charstream.CharStream.peek.

Returns the next character on this stream but does not consume it.
public boolean
peek(char c)

Implements org.codehaus.janino.util.charstream.CharStream.peek.

Returns whether the character stream is not at end-of-input and the next character on this stream equals the given character.
public int
peek(String chars)

Implements org.codehaus.janino.util.charstream.CharStream.peek.

Checks whether the next character on this stream equals any of the characters of the given String.
public boolean
peekRead(char c)

Implements org.codehaus.janino.util.charstream.CharStream.peekRead.

If the next character on this stream equals the given character, it is consumed.
public int
peekRead(String chars)

Implements org.codehaus.janino.util.charstream.CharStream.peekRead.

If the next character on this stream is in the given String, it is consumed.
public char
read()

Implements org.codehaus.janino.util.charstream.CharStream.read.

Consumes and returns the next character on this stream.
public void
read(char c)

Implements org.codehaus.janino.util.charstream.CharStream.read.

Consumes the next character on this stream and verifies that it equals the given character.
public int
read(String chars)

Implements org.codehaus.janino.util.charstream.CharStream.read.

Consumes the nect character and verifies that it matches one of the characters of the given String.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

inback to summary
private final String in
posback to summary
private int pos

Constructor Detail

StringCharStreamback to summary
public StringCharStream(String in)

Method Detail

atEoiback to summary
public boolean atEoi()

Implements org.codehaus.janino.util.charstream.CharStream.atEoi.

Returns:boolean

Doc from org.codehaus.janino.util.charstream.CharStream.atEoi.

Whether this stream is at end-of-input

Annotations
@Override
eoiback to summary
public void eoi() throws UnexpectedCharacterException

Implements org.codehaus.janino.util.charstream.CharStream.eoi.

Annotations
@Override
Exceptions
UnexpectedCharacterException:

Doc from org.codehaus.janino.util.charstream.CharStream.eoi.

This stream is not at end-of-input

peekback to summary
public int peek()

Implements org.codehaus.janino.util.charstream.CharStream.peek.

Doc from org.codehaus.janino.util.charstream.CharStream.peek.

Returns the next character on this stream but does not consume it.

Returns:int

EOI This stream is at end-of-input

Annotations
@Override
peekback to summary
public boolean peek(char c)

Implements org.codehaus.janino.util.charstream.CharStream.peek.

Doc from org.codehaus.janino.util.charstream.CharStream.peek.

Returns whether the character stream is not at end-of-input and the next character on this stream equals the given character. Does not consume any characters.

Annotations
@Override
peekback to summary
public int peek(String chars)

Implements org.codehaus.janino.util.charstream.CharStream.peek.

Doc from org.codehaus.janino.util.charstream.CharStream.peek.

Checks whether the next character on this stream equals any of the characters of the given String. Does not consume any characters.

Returns:int

The position of the next character in the given String, or -1

Annotations
@Override
peekReadback to summary
public boolean peekRead(char c)

Implements org.codehaus.janino.util.charstream.CharStream.peekRead.

Doc from org.codehaus.janino.util.charstream.CharStream.peekRead.

If the next character on this stream equals the given character, it is consumed.

Returns:boolean

true iff the next character on this stream equals the given character

Annotations
@Override
peekReadback to summary
public int peekRead(String chars)

Implements org.codehaus.janino.util.charstream.CharStream.peekRead.

Doc from org.codehaus.janino.util.charstream.CharStream.peekRead.

If the next character on this stream is in the given String, it is consumed.

Returns:int

The position of the next character in the given String, or -1

Annotations
@Override
readback to summary
public char read() throws EOFException

Implements org.codehaus.janino.util.charstream.CharStream.read.

Doc from org.codehaus.janino.util.charstream.CharStream.read.

Consumes and returns the next character on this stream.

Annotations
@Override
Exceptions
EOFException:
This stream is at end-of-input
readback to summary
public void read(char c) throws EOFException, UnexpectedCharacterException

Implements org.codehaus.janino.util.charstream.CharStream.read.

Doc from org.codehaus.janino.util.charstream.CharStream.read.

Consumes the next character on this stream and verifies that it equals the given character.

Annotations
@Override
Exceptions
EOFException:
This stream is at end-of-input
UnexpectedCharacterException:
The next character does not equal the given character
readback to summary
public int read(String chars) throws EOFException, UnexpectedCharacterException

Implements org.codehaus.janino.util.charstream.CharStream.read.

Doc from org.codehaus.janino.util.charstream.CharStream.read.

Consumes the nect character and verifies that it matches one of the characters of the given String.

Returns:int

The position of the next character in the given String

Annotations
@Override
Exceptions
EOFException:
This stream is at end-of-input
UnexpectedCharacterException:
The next character on this stream is not in the given String
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override