org.extex.base.type.file
Class InputFile

java.lang.Object
  extended by org.extex.base.type.file.InputFile
All Implemented Interfaces:
java.io.Serializable, InFile

public class InputFile
extends java.lang.Object
implements InFile

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

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
InputFile(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()
          Check if this stream is attached to a file.
 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

InputFile

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

Parameters:
inStream - the token stream to read from
isStandard - the stream is the standard input stream
Method Detail

close

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

Specified by:
close in interface InFile
See Also:
InFile.close()

isEof

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

Specified by:
isEof in interface InFile
Returns:
true iff no further token can be read.
Throws:
NoHelpException
See Also:
InFile.isEof()

isFileStream

public boolean isFileStream()
Check if this stream is attached to a file.

Specified by:
isFileStream in interface InFile
Returns:
true if this stream reads from a file
See Also:
InFile.isFileStream()

isOpen

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

Specified by:
isOpen in interface InFile
Returns:
true iff the input stream has still a stream assigned to it.
See Also:
InFile.isOpen()

isStandardStream

public boolean isStandardStream()
Getter for standardStream.

Specified by:
isStandardStream in interface InFile
Returns:
the standardStream
See Also:
InFile.isStandardStream()

read

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

Specified by:
read in interface InFile
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:
NoHelpException
See Also:
InFile.read(org.extex.scanner.type.token.TokenFactory, org.extex.scanner.api.Tokenizer)