wt.util
Class UserMessage

java.lang.Object
  extended bywt.util.UserMessage

public class UserMessage
extends Object

UserMessage is class, which will accept messages that need to be directed to the applet/application User. It is the responsibility of the application to determine how to handle the messages. The default behavior is to pass the message along to System.out.println().

This class was created with the idea that it would be enhanced to handle messages in various ways. Printing to an output stream is just the first, and most basic, mechanism.

UserMessage provides a means of sending messages to the console, when the application has use LogFile to re-direct debugging messages, sent to System.out, to a log file.

The following is an example of how UserMessage message would be directed to System.out:

    // initialize UserMessage to System.out
    UserMessage.init( System.out );          
 

// initialize log file, which will redirect System.out to the log file LogFile.init(LOG_FILE, false, false);

UserMessage.send( "You do not have the access necessary to perform this action." );

See Also:
LogFile, PrintStream, System.out

Field Summary
private static PrintStream stdOut
           
 
Constructor Summary
UserMessage()
           
 
Method Summary
static void init(PrintStream newOut)
          Initialize with a PrintStream, which messages will be streamed to.
static void send(String message)
          Send a message to the user.
static void sendWithoutLineBreak(String message)
          Send a message to the user without a line break after the output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stdOut

private static PrintStream stdOut
Constructor Detail

UserMessage

public UserMessage()
Method Detail

init

public static void init(PrintStream newOut)
Initialize with a PrintStream, which messages will be streamed to.

Parameters:
newOut - the ouput stream, where messages will be sent.

send

public static void send(String message)
Send a message to the user.

Parameters:
message - the message that needs to be delivered to the user.

sendWithoutLineBreak

public static void sendWithoutLineBreak(String message)
Send a message to the user without a line break after the output.

Parameters:
message - the message that needs to be delivered to the user.