xbn.output
Class OConfig

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.output.OConfig
All Implemented Interfaces:
Named

public class OConfig
extends XBNObject
implements Named

Configuration for a single "level" of output, consisting of a MsgFormat and on/off state. This is for use in Outputter.

Source code:  OConfig.java

A OConfig contains three elements:


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
OConfig()
          Create an OConfig.
OConfig(boolean b_on)
          Create an OConfig.
OConfig(MsgFormat msg_format)
          Create an OConfig.
OConfig(MsgFormat msg_format, boolean b_on)
          Create an OConfig.
OConfig(String s_name, MsgFormat msg_format, boolean b_on)
          Create an OConfig.
 
Method Summary
 String getFormatted(boolean b_useIndent, String s_message)
          Given the provided message body, what is the full message?
 MsgFormat getMsgFormat()
          Get the MsgFormat for direct manipulation.
 String getName()
          What is the name of this object?.
 boolean isOn()
          Is this OConfig output level on or off?
 void setMsgFormat(MsgFormat msg_format)
          Set the MsgFormat.
 void setOn(boolean b_on)
          Turn this OConfig output level on or off.
 String toString()
          Get some information about this OConfig object.
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OConfig

public OConfig()

Create an OConfig.

Equal to OConfig(false)


OConfig

public OConfig(boolean b_on)

Create an OConfig.

Equal to OConfig((new MFPlain()), b_on)


OConfig

public OConfig(MsgFormat msg_format)

Create an OConfig.

Equal to OConfig(msg_format, false)


OConfig

public OConfig(MsgFormat msg_format,
               boolean b_on)

Create an OConfig.

Equal to OConfig(null, msg_format, b_on)


OConfig

public OConfig(String s_name,
               MsgFormat msg_format,
               boolean b_on)

Create an OConfig.

Parameters:
s_name - The name of this OConfig object. See getName.
msg_format - The MsgFormat. See setMsgFormat and getMsgFormat .
b_on - If true, this output level is on. If false, this output level is off. See setOn and isOn.
Method Detail

setMsgFormat

public final void setMsgFormat(MsgFormat msg_format)

Set the MsgFormat.

Parameters:
msg_format - The MsgFormat. May not be null. If no prefix is desired, set this to (new MFPlain()).

getMsgFormat

public MsgFormat getMsgFormat()

Get the MsgFormat for direct manipulation.


setOn

public final void setOn(boolean b_on)

Turn this OConfig output level on or off.

Get with isOn.

Parameters:
b_on - If true, then this output level is on. If false, this output level is off.

isOn

public boolean isOn()

Is this OConfig output level on or off?

Set with setOn.

This setting is only notification for external classes, it does not directly affect (nor is used by) anything in this class.

Returns:
true If this output level is on.
false If this output level is off.

getFormatted

public String getFormatted(boolean b_useIndent,
                           String s_message)

Given the provided message body, what is the full message?

Parameters:
s_message - The body of the message.
Returns:
getMsgFormat().getFormatted(b_useIndent, s_message)

toString

public String toString()

Get some information about this OConfig object.

Overrides:
toString in class Object

getName

public String getName()
Description copied from interface: Named

What is the name of this object?. This identifier is used throughout the xbn.named package, particularly in NamedArray.

Specified by:
getName in interface Named



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo