de.dante.extex.interpreter.type.file
Class InFile

java.lang.Object
  extended byde.dante.extex.interpreter.type.file.InFile
All Implemented Interfaces:
java.io.Serializable

public class InFile
extends java.lang.Object
implements java.io.Serializable

This class holds an input file from which tokens can be read.

Version:
$Revision: 1.20 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
InFile(TokenStream inStream, boolean isStandard)
          Creates a new object.
 
Method Summary
 void close()
          Close the current stream.
 boolean isEof()
          Checks whether this InFile is at end of file.
 boolean isFileStream()
           
 boolean isOpen()
          Check whether this InFile is currently opened for reading.
 boolean isStandardStream()
          Getter for standardStream.
 Tokens read(TokenFactory factory, Tokenizer tokenizer)
          Read a line of characters into a tokens list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

InFile

public InFile(TokenStream inStream,
              boolean isStandard)
Creates a new object.

Parameters:
inStream - the token stream to read from
Method Detail

close

public void close()
Close the current stream. No reading operation is possible afterwards.


isEof

public boolean isEof()
              throws InterpreterException
Checks whether this InFile is at end of file.

Returns:
true iff no further token can be read.
Throws:
InterpreterException - in case of an error

isFileStream

public boolean isFileStream()
See Also:
TokenStream.isFileStream()

isOpen

public boolean isOpen()
Check whether this InFile is currently opened for reading.

Returns:
true iff the input stream has still a stream assigned to it.

isStandardStream

public boolean isStandardStream()
Getter for standardStream.

Returns:
the standardStream

read

public Tokens read(TokenFactory factory,
                   Tokenizer tokenizer)
            throws InterpreterException
Read a line of characters into a tokens list.

Parameters:
factory - the factory to request new tokens from
tokenizer - the tokenizer to use
Returns:
the tokens read or null in case of eof
Throws:
InterpreterException - in case of an error