net.directj.jlogger
Class StreamOutput

java.lang.Object
  |
  +--net.directj.jlogger.StreamOutput
All Implemented Interfaces:
Output
Direct Known Subclasses:
ConsoleOutput

public class StreamOutput
extends java.lang.Object
implements Output

This is a simple class that print logging information into a stream. The header and footer information are not handle. You can use this to write onto any type of ouput stream, including file or network. WARNING: This class just print the specified string, but without a NL\CR character. The formatter HAVE TO take care of 'NL\CR' ('\n' in java) char.

Version:
0.1.2
Author:
CARTAPANIS Alexandre <earendil@jprolog.net>

Nested Class Summary
private  class StreamOutput.ShutdownHook
          This class is used to close the stream at the end of the JVM.
 
Field Summary
private  java.io.OutputStream out
          The output stream.
 
Constructor Summary
StreamOutput(java.io.OutputStream _out)
          Creates a new StreamOutput.
 
Method Summary
 boolean equals(java.lang.Object _obj)
          Indicates whether some other object is "equal to" this one.
 int hashCode()
          Returns a hash code value for the object.
 void print(java.lang.String _str)
          Prints the info, using the output.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private java.io.OutputStream out
The output stream.

Constructor Detail

StreamOutput

public StreamOutput(java.io.OutputStream _out)
Creates a new StreamOutput.

Parameters:
_out - The outputStream where to write data.
Method Detail

print

public void print(java.lang.String _str)
Prints the info, using the output.

Specified by:
print in interface Output
Parameters:
_str - The debugging info to print on the output.
See Also:
Formatter

equals

public boolean equals(java.lang.Object _obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class java.lang.Object
Parameters:
_obj - The reference object with which to compare.
Returns:
boolean - True if this object is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

Overrides:
hashCode in class java.lang.Object
Returns:
int - A hash code value for this object.


Copyright 2002 CARTAPANIS Alexandre
This page was last updated on May 10 2003