net.directj.jlogger
Class NetworkOutput

java.lang.Object
  |
  +--net.directj.jlogger.NetworkOutput
All Implemented Interfaces:
ClientListener, java.util.EventListener, Output

public class NetworkOutput
extends java.lang.Object
implements Output, ClientListener

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

Nested Class Summary
private  class NetworkOutput.ShutdownHook
          This class is used to stop the client at the end of the JVM.
 
Field Summary
private  java.net.InetAddress address
          The distant server's inet address.
private  Client client
          The client that connect to the distant server.
private  int port
          The distant server's port.
 
Constructor Summary
NetworkOutput(int _port, java.net.InetAddress _address)
          Creates a new NetworkOutput.
 
Method Summary
 void clientEvent(ClientEvent _evt)
          Any class implementing this will receive messages that are received by the client.
 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

port

private int port
The distant server's port.


address

private java.net.InetAddress address
The distant server's inet address.


client

private Client client
The client that connect to the distant server.

Constructor Detail

NetworkOutput

public NetworkOutput(int _port,
                     java.net.InetAddress _address)
Creates a new NetworkOutput.

Parameters:
_port - The distant server's port.
_address - The distant server's address.
Method Detail

clientEvent

public void clientEvent(ClientEvent _evt)
Any class implementing this will receive messages that are received by the client.

Specified by:
clientEvent in interface ClientListener
Parameters:
_evt - A client event

print

public void print(java.lang.String _str)
Prints the info, using the output. WARNING: The string must use the 'type|name|message' pattern, eand end with a '\n' char.

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