edu.buffalo.nsf.xmlcqa.data.stream
Class FileTokenSink

java.lang.Object
  extended byedu.buffalo.nsf.xmlcqa.data.stream.FileTokenSink
All Implemented Interfaces:
TokenSink

public class FileTokenSink
extends java.lang.Object
implements TokenSink

An implementation of TokenSink based on a file writer.

Author:
staworko

Field Summary
protected  java.io.PrintWriter out
          A writer to which the tokens are being serialized.
protected  java.util.Stack stack
          Stack contining currently opened tokens.
 
Constructor Summary
FileTokenSink(java.io.File f)
          Standard constructor.
FileTokenSink(java.lang.String fileName)
          Standard constructor
 
Method Summary
 void close()
          Method closing the sink.
 void consume(Token t)
          Method consuming a token.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected java.io.PrintWriter out
A writer to which the tokens are being serialized.


stack

protected java.util.Stack stack
Stack contining currently opened tokens. This structure suppoorts controling if the input token stream is balanced.

Constructor Detail

FileTokenSink

public FileTokenSink(java.io.File f)
              throws java.io.IOException
Standard constructor.


FileTokenSink

public FileTokenSink(java.lang.String fileName)
              throws java.io.IOException
Standard constructor

Method Detail

close

public void close()
Description copied from interface: TokenSink
Method closing the sink. After call to this method no other methods should be used.

Specified by:
close in interface TokenSink

consume

public void consume(Token t)
Description copied from interface: TokenSink
Method consuming a token.

Specified by:
consume in interface TokenSink