org.extex.base.type.file
Class UserAndLogFile

java.lang.Object
  extended by org.extex.base.type.file.OutputFile
      extended by org.extex.base.type.file.UserAndLogFile
All Implemented Interfaces:
java.io.Serializable, OutFile

public class UserAndLogFile
extends OutputFile

This implementation of an OutFile encapsulates a Logger. It outputs the items to the log file and the console.

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

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Constructor Summary
UserAndLogFile(java.util.logging.Logger logger)
          Creates a new object.
 
Method Summary
 void close()
          Close the current file.
 boolean isOpen()
          Check whether the output file is open.
 void newline()
          Write out a newline.
 void open(java.lang.String key, java.lang.String encoding, TokenStreamFactory factory)
          Open the current file.
 boolean write(Tokens toks)
          Write some tokens to the output writer.
 
Methods inherited from class org.extex.base.type.file.OutputFile
use
 
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

UserAndLogFile

public UserAndLogFile(java.util.logging.Logger logger)
Creates a new object.

Parameters:
logger - the target Logger
Method Detail

close

public void close()
           throws java.io.IOException
Close the current file.

Specified by:
close in interface OutFile
Overrides:
close in class OutputFile
Throws:
java.io.IOException - in case of an error
See Also:
OutFile.close()

isOpen

public boolean isOpen()
Check whether the output file is open.

Specified by:
isOpen in interface OutFile
Overrides:
isOpen in class OutputFile
Returns:
true iff the instance is open
See Also:
OutFile.isOpen()

newline

public void newline()
             throws java.io.IOException
Write out a newline.

Specified by:
newline in interface OutFile
Overrides:
newline in class OutputFile
Throws:
java.io.IOException - in case of an error
See Also:
OutputFile.newline()

open

public void open(java.lang.String key,
                 java.lang.String encoding,
                 TokenStreamFactory factory)
Open the current file. Open the current file.

Specified by:
open in interface OutFile
Overrides:
open in class OutputFile
Parameters:
key - the key
encoding - the encoding or null for the default encoding
factory - the token stream factory
See Also:
OutputFile.open(String, java.lang.String, TokenStreamFactory)

write

public boolean write(Tokens toks)
              throws java.io.IOException
Write some tokens to the output writer.

Specified by:
write in interface OutFile
Overrides:
write in class OutputFile
Parameters:
toks - tokens to write
Returns:
true iff the writing was successful
Throws:
java.io.IOException - in case of an IO error
See Also:
OutputFile.write( org.extex.scanner.type.tokens.Tokens)