JMSLTM Numerical Library 5.0.1

com.imsl
Class Warning

java.lang.Object
  extended by com.imsl.Warning

public final class Warning
extends Object

Handle warning messages. This class maintains a single, private, WarningObject that actually displays the warning messages.


Constructor Summary
Warning()
           
 
Method Summary
static WarningObject getWarning()
          Gets the WarningObject.
static void print(Object source, String bundleName, String key, Object[] arg)
          Issue a warning message.
static void setOut(PrintStream out)
          Reassigns the output stream.
static void setWarning(WarningObject warningObject)
          Sets a new WarningObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Warning

public Warning()
Method Detail

getWarning

public static WarningObject getWarning()
Gets the WarningObject.

Returns:
The current warning object.

print

public static void print(Object source,
                         String bundleName,
                         String key,
                         Object[] arg)
Issue a warning message. Warning messages are stored as MessageFormat patterns in a ResourceBundle. This method retrieves the pattern from the bundle, formats the message with the supplied arguments, and prints the message to the warning stream.

Parameters:
source - is the object that is the source of the warning.
bundleName - is the prefix of the ResourceBundle name. The actual name is formed by appending ".ErrorMessages".
key - identifies the warning message in the bundle.
arg - are the arguments used to format the message.
See Also:
ResourceBundle, MessageFormat

setOut

public static void setOut(PrintStream out)
Reassigns the output stream. The default warning stream is @see System.err.

Parameters:
out - is the new warning output stream. It may be null, in which case warnings are not printed.

setWarning

public static void setWarning(WarningObject warningObject)
Sets a new WarningObject. Replacing the WarningObject allows warning errors to be handled in a more custom fashion.

Parameters:
warningObject - is the new WarningObject. It may be null, in which case error messages will be ignored.

JMSLTM Numerical Library 5.0.1

Copyright © 1970-2008 Visual Numerics, Inc.
Built July 8 2008.