byucc.jhdl
Class JHDLOutput

java.lang.Object
  extended bybyucc.jhdl.JHDLOutput

public class JHDLOutput
extends java.lang.Object

A utility class useful for managing messages in JHDL.

Messages generated within JHDL are directed to various streams of a named JHDLOutput object. Common streams are: "default", for general comments; "builder", for messages related to building the JHDL circuit; "simulator", for messages related to simulation; "netlister", for messages during the netlist process; "checkpoint" for messages related to circuit checkpointing and readback; and "jab", for messages that relate to the graphical brower JAB.

Each JHDLOutput is made up of multiple streams; messages printed to the various streams can be directed to the same location or to different locations. The streams available are: debug, for debug messages during development; notice, for notification of deprecated method calls or alternative syntax; status, for tracking status during long algorithms; warning, when a problem is detected but is not fatal; and error, when a problem can have fatal results to the operation of JHDL.

Version:
1.0
Author:
Michael Halcrow

Field Summary
 JHDLPrintWriter debug
          The debug stream, for posting debug comments; defaults to disabled
static int DEBUG
           
 JHDLPrintWriter error
          The error stream, for reporting fatal errors; should default to System.err
static int ERROR
           
static int NOTE
           
 JHDLPrintWriter notice
          The notice stream, for posting notices (such as deprecations); defaults to System.out
static int NOTICE
           
static int NOTIFICATION
           
static int NOTIFY
           
static int NUMBER_OF_PRINTWRITER_IDENTIFIERS
           
 JHDLPrintWriter status
          The status stream, for reporting status (such as during long operations, or to get the values of certain variables); defaults to System.out
static int STATUS
           
static int WARN
           
 JHDLPrintWriter warning
          The warning stream, for reporting non-fatal warnings; defaults to System.out
static int WARNING
           
 
Method Summary
 void disableAllJHDLPrintWriters()
           
 void enableAllJHDLPrintWriters()
           
static JHDLOutput getJHDLOutput()
          Returns a JHDLOutput identified as "default".
static JHDLOutput getJHDLOutput(java.lang.String name)
          Returns the requested instance of JHDLOutput, identified by a string.
static java.lang.String[] getJHDLOutputNames()
          Returns an array with all the JHDLOutput<\code> object names currently created.
 JHDLPrintWriter getJHDLPrintWriter(int jhdlPrintWriterID)
          Returns the JHDLPrintWriter that correlates with jhdlPrintWriterID.
static int getJHDLPrintWriterIdentifier(java.lang.String jhdlPrintWriterName)
           
static java.lang.String getJHDLPrintWriterName(int jhdlPrintWriterID)
          A convenience method for debug messages
static boolean isAvailable(java.lang.String name)
          Tells whether or not a JHDLOutput with a specific name has been created.
static void parseLine(java.lang.String line)
           
 boolean redirect(int jhdlPrintWriterID)
          Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to null.
 boolean redirect(int jhdlPrintWriterID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to outputStream.
 boolean redirect(int jhdlPrintWriterID, java.io.OutputStream outputStream, boolean autoFlush)
          Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to outputStream.
 boolean redirect(int jhdlPrintWriterID, java.io.Writer outputWriter)
          Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to a Writer.
 boolean redirect(int jhdlPrintWriterID, java.io.Writer outputStream, boolean autoFlush)
          Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to a Writer.
static boolean redirect(java.lang.String jhdlOutputID, int jhdlPrintWriterID)
          Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to null.
static boolean redirect(java.lang.String jhdlOutputID, int jhdlPrintWriterID, java.io.OutputStream outputStream)
          Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to the OutputStream object passed by the caller.
static boolean redirect(java.lang.String jhdlOutputID, int jhdlPrintWriterID, java.io.OutputStream outputStream, boolean autoFlush)
          Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to the OutputStream object passed by the caller.
static boolean redirect(java.lang.String jhdlOutputID, int jhdlPrintWriterID, java.io.Writer outputStream)
          Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to the Writer object passed by the caller.
static boolean redirect(java.lang.String jhdlOutputID, int jhdlPrintWriterID, java.io.Writer outputStream, boolean autoFlush)
          Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to the Writer object passed by the caller.
 boolean redirectAll(java.io.OutputStream outputStream)
          Redirects all JHDLPrintWriter instances across the JHDLOutput instance from which it is called to outputStream.
static boolean redirectAll(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects all JHDLPrintWriter instances within the JHDLOutput identified by jhdlOutputID to outputStream.
static boolean redirectAll(java.lang.String jhdlOutputID, java.io.Writer outputStream)
          Redirects all JHDLPrintWriter instances within the JHDLOutput identified by jhdlOutputID to a Writer.
 boolean redirectAll(java.io.Writer outputStream)
          Redirects all JHDLPrintWriter instances across the JHDLOutput instance from which it is called to outputStream.
static boolean redirectAllJHDLOutputs(java.io.OutputStream outputStream)
          Redirects all JHDLPrintWriter instances across all JHDLOutput instances to outputStream.
static boolean redirectAllJHDLOutputs(java.io.Writer outputStream)
          Redirects all JHDLPrintWriter instances across all JHDLOutput instances to a Writer.
 boolean redirectDebug(java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named debug to the given OutputStream.
static boolean redirectDebug(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named debug to the given OutputStream.
 boolean redirectErr(java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named error to the given OutputStream.
static boolean redirectErr(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named error to the given OutputStream.
 boolean redirectError(java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named error to the given OutputStream.
static boolean redirectError(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named error to the given OutputStream.
 boolean redirectNotice(java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named notice to the given OutputStream.
static boolean redirectNotice(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named notice to the given OutputStream.
 boolean redirectNotify(java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named notice to the given OutputStream.
static boolean redirectNotify(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named notice to the given OutputStream.
 boolean redirectStatus(java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named status to the given OutputStream.
static boolean redirectStatus(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named status to the given OutputStream.
 boolean redirectWarn(java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named warning to the given OutputStream.
static boolean redirectWarn(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named warning to the given OutputStream.
 boolean redirectWarning(java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named warning to the given OutputStream.
static boolean redirectWarning(java.lang.String jhdlOutputID, java.io.OutputStream outputStream)
          Redirects the JHDLPrintWriter instance named warning to the given OutputStream.
static boolean setAllJHDLOutputsToConsole()
          This method sets all JHDLPrintWriter's in all existing JHDLOutput objects to print to System.out.
static boolean setAllJHDLOutputsToFile(java.lang.String fileName)
          Sets all JHDLPrintWriter instances in all existing JHDLOutput instances to print to the file named fileName.
static boolean setAllJHDLOutputsToNothing()
          Disables all JHDLPrintWriters in all JHDLOutputs.
 boolean setAllToConsole()
          Set all streams of this JHDLPrintWriter to System.out.
static boolean setAllToConsole(java.lang.String jhdlOutputID)
          Sets all JHDLPrintWriter's in the JHDLOutput instance referenced in the JHDLOutputs hashtable by the jhdlOutputID key to System.out.
 boolean setAllToFile(java.lang.String fileName)
          Sets all JHDLPrintWriter instances in this JHDLOutput object to the given fileName.
static boolean setAllToFile(java.lang.String jhdlOutputID, java.lang.String fileName)
          Redirects all JHDLPrintWriter objects for the given jhdlOutputID to the file named fileName.
 boolean setAllToNothing()
          Redirects all JHDLPrintWriter instances in this instance of JHDLOutput to null.
static boolean setAllToNothing(java.lang.String jhdlOutputID)
          Sets all of the JHDLPrintWriter instances in the named JHDLOutput to not print.
 void setDefaultDebugJHDLPrintWriter(JHDLPrintWriter passed)
           
 void setDefaultDebugOutputStream(java.io.OutputStream passedStream)
           
 void setDefaultErrorJHDLPrintWriter(JHDLPrintWriter passed)
           
 void setDefaultErrorOutputStream(java.io.OutputStream passedStream)
           
 void setDefaultJHDLPrintWriter(int jhdlPrintWriterID, JHDLPrintWriter passed)
           
 void setDefaultJHDLPrintWriter(int jhdlPrintWriterID, java.io.OutputStream passedStream)
           
 void setDefaultNoticeJHDLPrintWriter(JHDLPrintWriter passed)
           
 void setDefaultNoticeOutputStream(java.io.OutputStream passedStream)
           
 void setDefaultOutputStream(int jhdlPrintWriterID, java.io.OutputStream passedStream)
           
 void setDefaultStatusJHDLPrintWriter(JHDLPrintWriter passed)
           
 void setDefaultStatusOutputStream(java.io.OutputStream passedStream)
           
 void setDefaultWarningJHDLPrintWriter(JHDLPrintWriter passed)
           
 void setDefaultWarningOutputStream(java.io.OutputStream passedStream)
           
 boolean setJHDLPrintWriter(int jhdlPrintWriterID, JHDLPrintWriter passedJHDLPrintWriter)
          Based on the jhdlPrintWriterID passed to this method, it will set the correlating JHDLPrintWriter reference to passedJHDLPrintWriter.
 boolean setToConsole(int jhdlPrintWriterID)
          Set the local instance of the JHDLPrintWriter identified by jhdlPrintWriterID to System.out.
static boolean setToConsole(java.lang.String jhdlOutputID, int jhdlPrintWriterID)
          Sets the JHDLPrintWriter identified by jhdlPrintWriterID in the named JHDLOutput to System.out.
 boolean setToFile(int jhdlPrintWriterID, java.lang.String fileName)
          Sets the JHDLPrintWriter object identified by jhdlPrintWriterID in this instance of JHDLOutput to the given fileName.
static boolean setToFile(java.lang.String jhdlOutputID, int jhdlPrintWriterID, java.lang.String fileName)
          Sets the JHDLPrintWriter identified by jhdlPrintWriterID in the named JHDLOutput to a file named fileName.
 boolean setToNothing(int jhdlPrintWriterID)
          Sets the instance of JHDLPrintWriter identified by jhdlPrintWriterID to null.
static boolean setToNothing(java.lang.String jhdlOutputID, int jhdlPrintWriterID)
          Sets the JHDLPrintWriter identified by jhdlPrintWriterID in the named JHDLOutput to not print.
 java.lang.String toString()
          Provides information about the JHDLOutput object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

WARN

public static final int WARN
See Also:
Constant Field Values

NOTIFICATION

public static final int NOTIFICATION
See Also:
Constant Field Values

NOTIFY

public static final int NOTIFY
See Also:
Constant Field Values

NOTICE

public static final int NOTICE
See Also:
Constant Field Values

NOTE

public static final int NOTE
See Also:
Constant Field Values

DEBUG

public static final int DEBUG
See Also:
Constant Field Values

STATUS

public static final int STATUS
See Also:
Constant Field Values

NUMBER_OF_PRINTWRITER_IDENTIFIERS

public static final int NUMBER_OF_PRINTWRITER_IDENTIFIERS
See Also:
Constant Field Values

error

public JHDLPrintWriter error
The error stream, for reporting fatal errors; should default to System.err


warning

public JHDLPrintWriter warning
The warning stream, for reporting non-fatal warnings; defaults to System.out


notice

public JHDLPrintWriter notice
The notice stream, for posting notices (such as deprecations); defaults to System.out


status

public JHDLPrintWriter status
The status stream, for reporting status (such as during long operations, or to get the values of certain variables); defaults to System.out


debug

public JHDLPrintWriter debug
The debug stream, for posting debug comments; defaults to disabled

Method Detail

parseLine

public static void parseLine(java.lang.String line)

enableAllJHDLPrintWriters

public void enableAllJHDLPrintWriters()

disableAllJHDLPrintWriters

public void disableAllJHDLPrintWriters()

setDefaultOutputStream

public void setDefaultOutputStream(int jhdlPrintWriterID,
                                   java.io.OutputStream passedStream)

setDefaultJHDLPrintWriter

public void setDefaultJHDLPrintWriter(int jhdlPrintWriterID,
                                      java.io.OutputStream passedStream)

setDefaultJHDLPrintWriter

public void setDefaultJHDLPrintWriter(int jhdlPrintWriterID,
                                      JHDLPrintWriter passed)

setDefaultErrorOutputStream

public void setDefaultErrorOutputStream(java.io.OutputStream passedStream)

setDefaultWarningOutputStream

public void setDefaultWarningOutputStream(java.io.OutputStream passedStream)

setDefaultNoticeOutputStream

public void setDefaultNoticeOutputStream(java.io.OutputStream passedStream)

setDefaultDebugOutputStream

public void setDefaultDebugOutputStream(java.io.OutputStream passedStream)

setDefaultStatusOutputStream

public void setDefaultStatusOutputStream(java.io.OutputStream passedStream)

setDefaultErrorJHDLPrintWriter

public void setDefaultErrorJHDLPrintWriter(JHDLPrintWriter passed)

setDefaultWarningJHDLPrintWriter

public void setDefaultWarningJHDLPrintWriter(JHDLPrintWriter passed)

setDefaultNoticeJHDLPrintWriter

public void setDefaultNoticeJHDLPrintWriter(JHDLPrintWriter passed)

setDefaultDebugJHDLPrintWriter

public void setDefaultDebugJHDLPrintWriter(JHDLPrintWriter passed)

setDefaultStatusJHDLPrintWriter

public void setDefaultStatusJHDLPrintWriter(JHDLPrintWriter passed)

getJHDLOutput

public static JHDLOutput getJHDLOutput(java.lang.String name)
Returns the requested instance of JHDLOutput, identified by a string. If no JHDLOutput object exists with that name, one is created.

Parameters:
name - The name of the JHDLOutput.
Returns:
the JHDLOutput by that name

getJHDLOutput

public static JHDLOutput getJHDLOutput()
Returns a JHDLOutput identified as "default".

Returns:
the JHDLOutput by the name "default"

redirect

public static boolean redirect(java.lang.String jhdlOutputID,
                               int jhdlPrintWriterID)
Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to null.

Returns:
whether or not the attempted redirection was successful

redirect

public static boolean redirect(java.lang.String jhdlOutputID,
                               int jhdlPrintWriterID,
                               java.io.OutputStream outputStream)
Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to the OutputStream object passed by the caller.

Parameters:
outputStream - This is the OutputStream to which the specified JHDLPrintWriter is redirected. A null reference is legal, and simply disables that JHDLPrintWriter.
Returns:
whether or not the attempted redirection was successful

redirect

public static boolean redirect(java.lang.String jhdlOutputID,
                               int jhdlPrintWriterID,
                               java.io.OutputStream outputStream,
                               boolean autoFlush)
Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to the OutputStream object passed by the caller.

Parameters:
outputStream - This is the OutputStream to which the specified JHDLPrintWriter is redirected. A null reference is legal, and simply disables that JHDLPrintWriter.
autoFlush - whether to flush the output stream on every newline
Returns:
whether or not the attempted redirection was successful

redirect

public static boolean redirect(java.lang.String jhdlOutputID,
                               int jhdlPrintWriterID,
                               java.io.Writer outputStream)
Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to the Writer object passed by the caller.

Parameters:
outputStream - This is the Writer to which the specified JHDLPrintWriter is redirected. A null reference is legal, and simply disables that JHDLPrintWriter.
Returns:
whether or not the attempted redirection was successful

redirect

public static boolean redirect(java.lang.String jhdlOutputID,
                               int jhdlPrintWriterID,
                               java.io.Writer outputStream,
                               boolean autoFlush)
Redirects the OutputStream for a given JHDLPrintWriter (identified by its integer ID value) in a named JHDLOutput (i.e., "jab" or "simulator") to the Writer object passed by the caller.

Parameters:
outputStream - This is the OutputStream to which the specified JHDLPrintWriter is redirected. A null reference is legal, and simply disables that JHDLPrintWriter.
autoFlush - whether to flush the output stream on every newline
Returns:
whether or not the attempted redirection was successful

setJHDLPrintWriter

public boolean setJHDLPrintWriter(int jhdlPrintWriterID,
                                  JHDLPrintWriter passedJHDLPrintWriter)
Based on the jhdlPrintWriterID passed to this method, it will set the correlating JHDLPrintWriter reference to passedJHDLPrintWriter.

Parameters:
jhdlPrintWriterID - the ID number of the JHDLPrintWriter instance
passedJHDLPrintWriter - the new target of the specified JHDLPrintWriter
Returns:
true only if the jhdlPrintWriterID was valid

getJHDLPrintWriter

public JHDLPrintWriter getJHDLPrintWriter(int jhdlPrintWriterID)
Returns the JHDLPrintWriter that correlates with jhdlPrintWriterID.

Parameters:
jhdlPrintWriterID - the ID number of the JHDLPrintWriter instance to return
Returns:
the instance of JHDLPrintWriter that corresponds with jhdlPrintWriterID

redirect

public boolean redirect(int jhdlPrintWriterID)
Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to null.

Parameters:
jhdlPrintWriterID - the ID number of the JHDLPrintWriter instance to redirect
Returns:
whether or not the attempted redirection was successful

redirect

public boolean redirect(int jhdlPrintWriterID,
                        java.io.OutputStream outputStream,
                        boolean autoFlush)
Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to outputStream.

Parameters:
jhdlPrintWriterID - the ID number of the JHDLPrintWriter instance to redirect
outputStream - the OutputStream instance with which to instantiate the new JHDLPrintWriter
autoFlush - if true, the PrintWriter will flush its stream after every call to print() or println(); if false, it won't
Returns:
whether or not the attempted redirection was successful

redirect

public boolean redirect(int jhdlPrintWriterID,
                        java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to outputStream.

Parameters:
jhdlPrintWriterID - the ID number of the JHDLPrintWriter instance to redirect
outputStream - the OutputStream instance with which to instantiate the new JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirect

public boolean redirect(int jhdlPrintWriterID,
                        java.io.Writer outputStream,
                        boolean autoFlush)
Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to a Writer.

Parameters:
jhdlPrintWriterID - the ID number of the JHDLPrintWriter instance to redirect
outputStream - the Writer instance with which to instantiate the new JHDLPrintWriter
autoFlush - if true, the PrintWriter will flush its stream after every call to print() or println(); if false, it won't
Returns:
whether or not the attempted redirection was successful

redirect

public boolean redirect(int jhdlPrintWriterID,
                        java.io.Writer outputWriter)
Redirects the JHDLPrintWriter instance identified by jhdlPrintWriterID to a Writer.

Parameters:
jhdlPrintWriterID - the ID number of the JHDLPrintWriter instance to redirect
Returns:
whether or not the attempted redirection was successful

redirectAll

public static boolean redirectAll(java.lang.String jhdlOutputID,
                                  java.io.OutputStream outputStream)
Redirects all JHDLPrintWriter instances within the JHDLOutput identified by jhdlOutputID to outputStream.

Parameters:
jhdlOutputID - the ID number of the JHDLOutput instance to redirect
outputStream - the OutputStream instance with which to instantiate the new JHDLPrintWriter
Returns:
whether or not the attempted redirections were successful

redirectAll

public boolean redirectAll(java.io.OutputStream outputStream)
Redirects all JHDLPrintWriter instances across the JHDLOutput instance from which it is called to outputStream.

Parameters:
outputStream - the OutputStream instance with which to instantiate the new JHDLPrintWriter instances
Returns:
whether or not the attempted redirections were successful

redirectAllJHDLOutputs

public static boolean redirectAllJHDLOutputs(java.io.OutputStream outputStream)
Redirects all JHDLPrintWriter instances across all JHDLOutput instances to outputStream.

Parameters:
outputStream - the OutputStream instance with which to instantiate the new JHDLPrintWriter instances
Returns:
whether or not the attempted redirections were all successful

redirectAll

public static boolean redirectAll(java.lang.String jhdlOutputID,
                                  java.io.Writer outputStream)
Redirects all JHDLPrintWriter instances within the JHDLOutput identified by jhdlOutputID to a Writer.

Parameters:
jhdlOutputID - the ID number of the JHDLOutput instance to redirect
outputStream - the OutputStream instance with which to instantiate the new JHDLPrintWriter
Returns:
whether or not the attempted redirections were successful

redirectAll

public boolean redirectAll(java.io.Writer outputStream)
Redirects all JHDLPrintWriter instances across the JHDLOutput instance from which it is called to outputStream.

Parameters:
outputStream - the Writer instance with which to instantiate the new JHDLPrintWriter instances
Returns:
whether or not the attempted redirections were successful

redirectAllJHDLOutputs

public static boolean redirectAllJHDLOutputs(java.io.Writer outputStream)
Redirects all JHDLPrintWriter instances across all JHDLOutput instances to a Writer.

Parameters:
outputStream - the Writer instance with which to instantiate the new JHDLPrintWriter instances
Returns:
whether or not the attempted redirections were all successful

redirectError

public static boolean redirectError(java.lang.String jhdlOutputID,
                                    java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named error to the given OutputStream.

Returns:
whether or not the attempted redirection was successful

redirectError

public boolean redirectError(java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named error to the given OutputStream.

Returns:
whether or not the attempted redirection was successful

redirectErr

public static boolean redirectErr(java.lang.String jhdlOutputID,
                                  java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named error to the given OutputStream.

Parameters:
jhdlOutputID - the identifier of the JHDLOutput instance whose JHDLPrintWriter named error will be redirected
outputStream - the OutputStream with which to instantiate the JHDLPrintWriter named error
Returns:
whether or not the attempted redirection was successful

redirectErr

public boolean redirectErr(java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named error to the given OutputStream.

Parameters:
outputStream - the OutputStream with which to instantiate the JHDLPrintWriter named error
Returns:
whether or not the attempted redirection was successful

redirectWarning

public static boolean redirectWarning(java.lang.String jhdlOutputID,
                                      java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named warning to the given OutputStream.

Parameters:
jhdlOutputID - the identifier of the JHDLOutput instance affected
outputStream - the OutputStream to which to redirect the warning instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectWarning

public boolean redirectWarning(java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named warning to the given OutputStream.

Parameters:
outputStream - the OutputStream to which to redirect the warning instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectWarn

public static boolean redirectWarn(java.lang.String jhdlOutputID,
                                   java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named warning to the given OutputStream.

Parameters:
jhdlOutputID - the identifier of the JHDLOutput instance affected
outputStream - the OutputStream to which to redirect the warning instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectWarn

public boolean redirectWarn(java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named warning to the given OutputStream.

Parameters:
outputStream - the OutputStream to which to redirect the warning instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectNotice

public static boolean redirectNotice(java.lang.String jhdlOutputID,
                                     java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named notice to the given OutputStream.

Parameters:
jhdlOutputID - the identifier of the JHDLOutput affected
outputStream - the OutputStream to which to redirect the notice instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectNotice

public boolean redirectNotice(java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named notice to the given OutputStream.

Parameters:
outputStream - the OutputStream to which to redirect the notice instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectNotify

public static boolean redirectNotify(java.lang.String jhdlOutputID,
                                     java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named notice to the given OutputStream.

Parameters:
jhdlOutputID - the identifier of the JHDLOutput affected
outputStream - the OutputStream to which to redirect the notice instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectNotify

public boolean redirectNotify(java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named notice to the given OutputStream.

Parameters:
outputStream - the OutputStream to which to redirect the notice instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectStatus

public static boolean redirectStatus(java.lang.String jhdlOutputID,
                                     java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named status to the given OutputStream.

Parameters:
jhdlOutputID - the identifier of the JHDLOutput affected
outputStream - the OutputStream to which to redirect the status instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectStatus

public boolean redirectStatus(java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named status to the given OutputStream.

Parameters:
outputStream - the OutputStream to which to redirect the status instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectDebug

public static boolean redirectDebug(java.lang.String jhdlOutputID,
                                    java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named debug to the given OutputStream.

Parameters:
jhdlOutputID - the identifier of the JHDLOutput affected
outputStream - the OutputStream to which to redirect the debug instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

redirectDebug

public boolean redirectDebug(java.io.OutputStream outputStream)
Redirects the JHDLPrintWriter instance named debug to the given OutputStream.

Parameters:
outputStream - the OutputStream to which to redirect the debug instance of JHDLPrintWriter
Returns:
whether or not the attempted redirection was successful

setAllJHDLOutputsToConsole

public static boolean setAllJHDLOutputsToConsole()
This method sets all JHDLPrintWriter's in all existing JHDLOutput objects to print to System.out.

Returns:
true if this was successful

setAllToConsole

public boolean setAllToConsole()
Set all streams of this JHDLPrintWriter to System.out.

Returns:
true if this was successful

setAllToConsole

public static boolean setAllToConsole(java.lang.String jhdlOutputID)
Sets all JHDLPrintWriter's in the JHDLOutput instance referenced in the JHDLOutputs hashtable by the jhdlOutputID key to System.out.

Parameters:
jhdlOutputID - This identifier determines the JHDLOutput to redirect.
Returns:
true if this was successful

setToConsole

public static boolean setToConsole(java.lang.String jhdlOutputID,
                                   int jhdlPrintWriterID)
Sets the JHDLPrintWriter identified by jhdlPrintWriterID in the named JHDLOutput to System.out.

Parameters:
jhdlOutputID - the identifier of the instance of JHDLOutput to affect
jhdlPrintWriterID - the identifier of the instance of JHDLPrintWriter to redirect
Returns:
true if this was successful

setToConsole

public boolean setToConsole(int jhdlPrintWriterID)
Set the local instance of the JHDLPrintWriter identified by jhdlPrintWriterID to System.out.

Parameters:
jhdlPrintWriterID - the identifier of the instance of JHDLPrintWriter to redirect
Returns:
true if this was successful

setToFile

public static boolean setToFile(java.lang.String jhdlOutputID,
                                int jhdlPrintWriterID,
                                java.lang.String fileName)
Sets the JHDLPrintWriter identified by jhdlPrintWriterID in the named JHDLOutput to a file named fileName.

Parameters:
jhdlOutputID - the identifier for the instance of JHDLOutput whose JHDLPrintWriter will be set to a file
jhdlPrintWriterID - the identifier for the instance of JHDLPrintWriter to redirect to the given file
fileName - the name of the output file
Returns:
whether or not the attempted redirection was successful

setToFile

public boolean setToFile(int jhdlPrintWriterID,
                         java.lang.String fileName)
Sets the JHDLPrintWriter object identified by jhdlPrintWriterID in this instance of JHDLOutput to the given fileName.

Parameters:
jhdlPrintWriterID - the identifier for the instance of JHDLPrintWriter to redirect to the given file
fileName - the name of the output file
Returns:
whether or not the attempted redirection was successful

setAllJHDLOutputsToFile

public static boolean setAllJHDLOutputsToFile(java.lang.String fileName)
Sets all JHDLPrintWriter instances in all existing JHDLOutput instances to print to the file named fileName.

Parameters:
fileName - the name of the output file
Returns:
whether or not the attempted redirections were successful

setAllToFile

public boolean setAllToFile(java.lang.String fileName)
Sets all JHDLPrintWriter instances in this JHDLOutput object to the given fileName.

Parameters:
fileName - the name of the output file
Returns:
whether or not the attempted redirections were successful

setAllToFile

public static boolean setAllToFile(java.lang.String jhdlOutputID,
                                   java.lang.String fileName)
Redirects all JHDLPrintWriter objects for the given jhdlOutputID to the file named fileName.

Parameters:
jhdlOutputID - the identifier of the JHDLOutput object for which all instances of the JHDLPrintWriter object will be redirected to the file
fileName - the name of the output file
Returns:
whether or not the attempted redirections were successful

setToNothing

public static boolean setToNothing(java.lang.String jhdlOutputID,
                                   int jhdlPrintWriterID)
Sets the JHDLPrintWriter identified by jhdlPrintWriterID in the named JHDLOutput to not print.

Parameters:
jhdlOutputID - the identifier of the instance of JHDLOutput affected
jhdlPrintWriterID - the identifier of the instance of JHDLPrintWriter to be redirected to nothing
Returns:
whether or not the attempted redirection was successful

setToNothing

public boolean setToNothing(int jhdlPrintWriterID)
Sets the instance of JHDLPrintWriter identified by jhdlPrintWriterID to null.

Parameters:
jhdlPrintWriterID - the identifier of the JHDLPrintWriter to redirect to nothing
Returns:
whether or not the attempted redirection was successful

setAllToNothing

public static boolean setAllToNothing(java.lang.String jhdlOutputID)
Sets all of the JHDLPrintWriter instances in the named JHDLOutput to not print.

Parameters:
jhdlOutputID - the identifier of the instance of JHDLOutput
Returns:
whether or not the attempted redirections were successful

setAllJHDLOutputsToNothing

public static boolean setAllJHDLOutputsToNothing()
Disables all JHDLPrintWriters in all JHDLOutputs.

Returns:
whether or not the attempted redirections were successful

getJHDLOutputNames

public static java.lang.String[] getJHDLOutputNames()
Returns an array with all the JHDLOutput<\code> object names currently created.

Returns:
An array with all the JHDLOutput<\code> object names currently created.

isAvailable

public static boolean isAvailable(java.lang.String name)
Tells whether or not a JHDLOutput with a specific name has been created.

Parameters:
name - Name of JHDLOutput to look for.
Returns:
True is JHDLOutput with given name exists, false otherwise.

setAllToNothing

public boolean setAllToNothing()
Redirects all JHDLPrintWriter instances in this instance of JHDLOutput to null.

Returns:
whether or not the attempted redirections were successful

getJHDLPrintWriterName

public static java.lang.String getJHDLPrintWriterName(int jhdlPrintWriterID)
A convenience method for debug messages

Parameters:
jhdlPrintWriterID - the constant integer representing a particular output stream
Returns:
a name for the printWriterID

getJHDLPrintWriterIdentifier

public static int getJHDLPrintWriterIdentifier(java.lang.String jhdlPrintWriterName)

toString

public java.lang.String toString()
Provides information about the JHDLOutput object

Returns:
the String describing this object


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.