xbn.config
Class UtilConfig

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.config.UtilConfig

public class UtilConfig
extends XBNObject

Convenience functions for reading in configuration variables via xbn.config classes.

Source code:  UtilConfig.java


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
UtilConfig()
          Create a UtilConfig.
 
Method Summary
 sb_sb_c[] getAOsb_sb_c(VWObject acosbsbc_cfgVars)
          Get an array of sb_sb_c-s from the array of objects existing in an VWObject/sb_sb_c array.
 sb_sb_c[] getAOsb_sb_c(VWObject acosbsbc_cfgVars, boolean b_crashIfNullElement)
          Get an array of sb_sb_c-s from the array of objects existing in an VWObject/sb_sb_c array.
 char getDelimiter(sb_sb_c sbsbc_cfgVar)
          Get the variable delimiter from the configuration variable.
 char getDelimiter(VWObject acosbsbc_cfgVars, int i_idx)
          Get the variable delimiter of the desired configuration variable.
 int getFoundIdx(VWObject acosbsbc_cfgVars, String s_rqdName)
          At what index in the provided VWObject/sb_sb_c array, is the requested name located?
 int getFoundIdx(VWObject acosbsbc_cfgVars, String s_rqdName, boolean b_crashIfNotFound)
          At what index in the provided VWObject/sb_sb_c array, is the requested name located?.
 StringBuffer getNameSB(sb_sb_c sbsbc_cfgVar)
          Get the name of the configuration variable as a StringBuffer.
 StringBuffer getNameSB(VWObject acosbsbc_cfgVars, int i_idx)
          Get the name of the desired configuration variable, as a StringBuffer.
 String getNameString(sb_sb_c sbsbc_cfgVar)
          Get the name of the configuration variable as a String.
 String getNameString(VWObject acosbsbc_cfgVars, int i_idx)
          Get the name of the desired configuration variable, as a String.
 sb_sb_c getsb_sb_c(VWObject acosbsbc_cfgVars, int i_idx)
          Translates the desired VWObject element to an sb_sb_c.
 sb_sb_c getsb_sb_cFromObj(Object o_bject)
          Convenience function for translating an Object to an sb_sb_c.
 boolean getValueBoolean(sb_sb_c sbsbc_cfgVar)
          Get the value of the configuration variable, as a boolean.
 boolean getValueBoolean(VWObject acosbsbc_cfgVars, int i_idx)
          Get the value of the desired configuration variable, as a boolean.
 boolean getValueBoolean(VWObject acosbsbc_cfgVars, int i_idx, String s_rqdName)
          Get the value of the desired configuration variable (which must have a particular name) as a boolean.
 boolean getValueBoolean(VWObject acosbsbc_cfgVars, int i_idx, String[] as_rqdNames)
          Get the value of the desired configuration variable (which must have a particular name) as a boolean.
 char getValueChar(sb_sb_c sbsbc_cfgVar)
          Get the value of the configuration variable, as a char.
 char getValueChar(VWObject acosbsbc_cfgVars, int i_idx)
          Get the value of the desired configuration variable, as a char.
 char getValueChar(VWObject acosbsbc_cfgVars, int i_idx, String s_rqdName)
          Get the value of the desired configuration variable (which must have a particular name) as a char.
 char getValueChar(VWObject acosbsbc_cfgVars, int i_idx, String[] as_rqdNames)
          Get the value of the desired configuration variable (which must have a particular name) as a char.
 double getValueDouble(sb_sb_c sbsbc_cfgVar)
          Get the value of the configuration variable, as a double.
 double getValueDouble(VWObject acosbsbc_cfgVars, int i_idx)
          Get the value of the desired configuration variable, as a double.
 double getValueDouble(VWObject acosbsbc_cfgVars, int i_idx, String s_rqdName)
          Get the value of the desired configuration variable (which must have a particular name) as a double.
 double getValueDouble(VWObject acosbsbc_cfgVars, int i_idx, String[] as_rqdNames)
          Get the value of the desired configuration variable (which must have a particular name) as a double.
 int getValueInt(sb_sb_c sbsbc_cfgVar)
          Get the value of the configuration variable, as an int.
 int getValueInt(VWObject acosbsbc_cfgVars, int i_idx)
          Get the value of the desired configuration variable, as an int.
 int getValueInt(VWObject acosbsbc_cfgVars, int i_idx, String s_rqdName)
          Get the value of the desired configuration variable (which must have a particular name) as an int.
 int getValueInt(VWObject acosbsbc_cfgVars, int i_idx, String[] as_rqdNames)
          Get the value of the desired configuration variable (which must have a particular name) as an int.
 StringBuffer getValueSB(sb_sb_c sbsbc_cfgVar)
          Get the value of the configuration variable, as a StringBuffer.
 StringBuffer getValueSB(VWObject acosbsbc_cfgVars, int i_idx)
          Get the value of the desired configuration variable, as a StringBuffer.
 StringBuffer getValueSB(VWObject acosbsbc_cfgVars, int i_idx, String s_rqdName)
          Get the value of the desired configuration variable (which must have a particular name) as a String.
 StringBuffer getValueSB(VWObject acosbsbc_cfgVars, int i_idx, String[] as_rqdNames)
          Get the value of the desired configuration variable (which must have a particular name) as a String.
 String getValueString(sb_sb_c sbsbc_cfgVar)
          Get the value of the configuration variable, as a string.
 String getValueString(VWObject acosbsbc_cfgVars, int i_idx)
          Get the value of the desired configuration variable, as a string.
 String getValueString(VWObject acosbsbc_cfgVars, int i_idx, String s_rqdName)
          Get the value of the desired configuration variable (which must have a particular name) as a double.
 String getValueString(VWObject acosbsbc_cfgVars, int i_idx, String[] as_rqdNames)
          Get the value of the desired configuration variable (which must have a particular name) as a string.
 boolean isAtIdx(VWObject acosbsbc_cfgVars, int i_idx, String[] as_rqdNames)
          Is the string at element X in the array of required names, equal to the name of the variable at that same element, X, within the VWObject/sb_sb_c array?
 boolean isAtIdx(VWObject acosbsbc_cfgVars, int i_idx, String[] as_rqdNames, boolean b_crashIfNotFoundAtIdx)
          Is the string at element X in the array of required names, equal to the name of the variable at that same element, X, within the VWObject/sb_sb_c array?
 
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, toString, wait, wait, wait
 

Constructor Detail

UtilConfig

public UtilConfig()

Create a UtilConfig. This constructor does nothing.

Method Detail

getsb_sb_cFromObj

public final sb_sb_c getsb_sb_cFromObj(Object o_bject)

Convenience function for translating an Object to an sb_sb_c.

Returns:
UtilPHFromObj.getsb_sb_c(o_bject)
Throws:
AssertException - If UtilPHFromObj.getsb_sb_c throws a NullPointerException or ClassCastException for any reason.

getsb_sb_c

public final sb_sb_c getsb_sb_c(VWObject acosbsbc_cfgVars,
                                int i_idx)

Translates the desired VWObject element to an sb_sb_c.

Parameters:
acosbsbc_cfgVars - The VWObject containing the configuration variables, in the form of sb_sb_c objects. May not be null, or less than [i_idx + 1] elements in length.
i_idx - The index representing the desired element in acosbsbc_cfgVars. May not be less than zero, or greater than [acosbsbc_cfgVars.size() - 1].
Returns:
getsb_sb_cFromObj(acosbsbc_cfgVars.getObject(i_idx))

getAOsb_sb_c

public final sb_sb_c[] getAOsb_sb_c(VWObject acosbsbc_cfgVars)

Get an array of sb_sb_c-s from the array of objects existing in an VWObject/sb_sb_c array.

Returns:
getAOsb_sb_c(acosbsbc_cfgVars, true)

getAOsb_sb_c

public final sb_sb_c[] getAOsb_sb_c(VWObject acosbsbc_cfgVars,
                                    boolean b_crashIfNullElement)

Get an array of sb_sb_c-s from the array of objects existing in an VWObject/sb_sb_c array.

Parameters:
acosbsbc_cfgVars - The VWObject containing the array configuration variables. May not be null.
b_crashIfNullElement - If true, then if any elements in acosbsbc_cfgVars are null, an AssertException is thrown with a descriptive error message. If false, then null elements in acosbsbc_cfgVars are translated to null elements in the returned array (and at the same position).
Returns:
An array of sb_sb_c, where each element is the same (or null) as existed in acosbsbc_cfgVars.

getFoundIdx

public final int getFoundIdx(VWObject acosbsbc_cfgVars,
                             String s_rqdName)

At what index in the provided VWObject/sb_sb_c array, is the requested name located?

Parameters:
acosbsbc_cfgVars - The VWObject containing the array configuration variables. May not be null.

getFoundIdx

public final int getFoundIdx(VWObject acosbsbc_cfgVars,
                             String s_rqdName,
                             boolean b_crashIfNotFound)

At what index in the provided VWObject/sb_sb_c array, is the requested name located?. See getNameSB.

Parameters:
acosbsbc_cfgVars - The VWObject containing the array configuration variables. May not be null.
s_rqdName - The name expected to exist in one of the acosbsbc_cfgVars elements. May not be null.
b_crashIfNotFoundAtIdx - If true, then instead of returning false, throw a descriptive AssertException instead. If false, then this function will return -1.
Returns:
An int representing the array index at which s_rqdName exists.
-1 if s_rqdName is not found, and b_crashIfNotFound equals false.

isAtIdx

public final boolean isAtIdx(VWObject acosbsbc_cfgVars,
                             int i_idx,
                             String[] as_rqdNames)

Is the string at element X in the array of required names, equal to the name of the variable at that same element, X, within the VWObject/sb_sb_c array?

Returns:
isAtIdx(acosbsbc_cfgVars, i_idx, as_rqdNames, false)

isAtIdx

public final boolean isAtIdx(VWObject acosbsbc_cfgVars,
                             int i_idx,
                             String[] as_rqdNames,
                             boolean b_crashIfNotFoundAtIdx)

Is the string at element X in the array of required names, equal to the name of the variable at that same element, X, within the VWObject/sb_sb_c array?

Parameters:
acosbsbc_cfgVars - The VWObject containing the array configuration variables, in the form of sb_sb_c objects. May not be null or less than [i_idx + 1] elements in length.
i_idx - The index representing the desired element in both acosbsbc_cfgVars and as_rqdNames. May not be less than zero, or greater than the lesser of [acosbsbc_cfgVars.size() - 1] and [as_rqdNames.length - 1].
as_rqdNames - The array of required names. May not be null or less than [i_idx + 1] elements in length.
b_crashIfNotFoundAtIdx - If true, then instead of returning false, throw a descriptive AssertException instead. If this parameter equals false, then this function will return false.
Returns:
true If element i_idx as_rqdNames in as_rqdNames equals the name in element i_idx of acosbsbc_cfgVars. false If otherwise.

getNameSB

public final StringBuffer getNameSB(sb_sb_c sbsbc_cfgVar)

Get the name of the configuration variable as a StringBuffer.

Returns:
sbsbc_cfgVar.sb1

getNameString

public final String getNameString(sb_sb_c sbsbc_cfgVar)

Get the name of the configuration variable as a String.

Returns:
getNameSB(sbsbc_cfgVar).toString()

getNameSB

public final StringBuffer getNameSB(VWObject acosbsbc_cfgVars,
                                    int i_idx)

Get the name of the desired configuration variable, as a StringBuffer.

Returns:
getNameSB(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getDelimiter

public final char getDelimiter(sb_sb_c sbsbc_cfgVar)

Get the variable delimiter from the configuration variable.

Returns:
sbsbc_cfgVar.c

getNameString

public final String getNameString(VWObject acosbsbc_cfgVars,
                                  int i_idx)

Get the name of the desired configuration variable, as a String.

Returns:
getNameString(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getDelimiter

public final char getDelimiter(VWObject acosbsbc_cfgVars,
                               int i_idx)

Get the variable delimiter of the desired configuration variable.

Returns:
getDelimiter(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueBoolean

public final boolean getValueBoolean(sb_sb_c sbsbc_cfgVar)

Get the value of the configuration variable, as a boolean.

Parameters:
sbsbc_cfgVar - The configuration variable. May not be null, and the string value must be equal to either 'true' or 'false'.
Returns:
A boolean represented by the string value of sbsbc_cfgVar.

getValueChar

public final char getValueChar(sb_sb_c sbsbc_cfgVar)

Get the value of the configuration variable, as a char.

Parameters:
sbsbc_cfgVar - The configuration variable. May not be null, and the string value must be exactly on character in length.
Returns:
A char represented by the string value of sbsbc_cfgVar.

getValueInt

public final int getValueInt(sb_sb_c sbsbc_cfgVar)

Get the value of the configuration variable, as an int.

Parameters:
sbsbc_cfgVar - The configuration variable. May not be null, and the string value must represent a valid int.
Returns:
(new Integer(getValueString(sbsbc_cfgVar))).intValue()

getValueDouble

public final double getValueDouble(sb_sb_c sbsbc_cfgVar)

Get the value of the configuration variable, as a double.

Parameters:
sbsbc_cfgVar - The configuration variable. May not be null, and the string value must represent a valid double.
Returns:
(new Double(getValueString(sbsbc_cfgVar))).doubleValue()

getValueString

public final String getValueString(sb_sb_c sbsbc_cfgVar)

Get the value of the configuration variable, as a string.

Parameters:
sbsbc_cfgVar - The configuration variable. May not be null.
Returns:
getValueString(sbsbc_cfgVar)

getValueSB

public final StringBuffer getValueSB(sb_sb_c sbsbc_cfgVar)

Get the value of the configuration variable, as a StringBuffer.

Parameters:
sbsbc_cfgVar - The configuration variable. May not be null.
Returns:
sbsbc_cfgVar.sb2

getValueBoolean

public final boolean getValueBoolean(VWObject acosbsbc_cfgVars,
                                     int i_idx)

Get the value of the desired configuration variable, as a boolean.

Returns:
getValueBoolean(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueChar

public final char getValueChar(VWObject acosbsbc_cfgVars,
                               int i_idx)

Get the value of the desired configuration variable, as a char.

Returns:
getValueChar(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueInt

public final int getValueInt(VWObject acosbsbc_cfgVars,
                             int i_idx)

Get the value of the desired configuration variable, as an int.

Returns:
getValueInt(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueDouble

public final double getValueDouble(VWObject acosbsbc_cfgVars,
                                   int i_idx)

Get the value of the desired configuration variable, as a double.

Returns:
getValueDouble(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueString

public final String getValueString(VWObject acosbsbc_cfgVars,
                                   int i_idx)

Get the value of the desired configuration variable, as a string.

Returns:
getValueString(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueSB

public final StringBuffer getValueSB(VWObject acosbsbc_cfgVars,
                                     int i_idx)

Get the value of the desired configuration variable, as a StringBuffer.

Returns:
getValueSB(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueBoolean

public final boolean getValueBoolean(VWObject acosbsbc_cfgVars,
                                     int i_idx,
                                     String s_rqdName)

Get the value of the desired configuration variable (which must have a particular name) as a boolean.

See getValueSB for parameter documentation.

Returns:
getValueBoolean(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueChar

public final char getValueChar(VWObject acosbsbc_cfgVars,
                               int i_idx,
                               String s_rqdName)

Get the value of the desired configuration variable (which must have a particular name) as a char.

See getValueSB for parameter and documentation.

Returns:
getValueChar(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueInt

public final int getValueInt(VWObject acosbsbc_cfgVars,
                             int i_idx,
                             String s_rqdName)

Get the value of the desired configuration variable (which must have a particular name) as an int.

See getValueSB for parameter and documentation.

Returns:
getValueInt(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueDouble

public final double getValueDouble(VWObject acosbsbc_cfgVars,
                                   int i_idx,
                                   String s_rqdName)

Get the value of the desired configuration variable (which must have a particular name) as a double.

See getValueSB for parameter and documentation.

Returns:
getValueDouble(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueString

public final String getValueString(VWObject acosbsbc_cfgVars,
                                   int i_idx,
                                   String s_rqdName)

Get the value of the desired configuration variable (which must have a particular name) as a double.

See getValueSB for parameter and documentation.

Returns:
getValueString(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueSB

public final StringBuffer getValueSB(VWObject acosbsbc_cfgVars,
                                     int i_idx,
                                     String s_rqdName)

Get the value of the desired configuration variable (which must have a particular name) as a String.

Parameters:
acosbsbc_cfgVars - The VWObject containing the array configuration variables, in the form of sb_sb_c objects. May not be null or less than [i_idx + 1] elements in length.
i_idx - The index representing the desired element in acosbsbc_cfgVars. May not be less than zero, or greater than [acosbsbc_cfgVars.size() - 1].
s_rqdName - The name expected to equal getsb_sb_c(acosbsbc_cfgVars, i_idx). May not be null and must equal the name of the i_idx-th element in acosbsbc_cfgVars.
Returns:
getValueBoolean(getsb_sb_c(acosbsbc_cfgVars, i_idx))

getValueBoolean

public final boolean getValueBoolean(VWObject acosbsbc_cfgVars,
                                     int i_idx,
                                     String[] as_rqdNames)

Get the value of the desired configuration variable (which must have a particular name) as a boolean.

See getValueSB for parameter documentation.

Returns:
getValueBoolean(getsb_sb_c(acosbsbc_cfgVars, i_idx, as_rqdNames))

getValueChar

public final char getValueChar(VWObject acosbsbc_cfgVars,
                               int i_idx,
                               String[] as_rqdNames)

Get the value of the desired configuration variable (which must have a particular name) as a char.

See getValueSB for parameter documentation.

Returns:
getValueChar(getsb_sb_c(acosbsbc_cfgVars, i_idx, as_rqdNames))

getValueInt

public final int getValueInt(VWObject acosbsbc_cfgVars,
                             int i_idx,
                             String[] as_rqdNames)

Get the value of the desired configuration variable (which must have a particular name) as an int.

See getValueSB for parameter documentation.

Returns:
getValueInt(getsb_sb_c(acosbsbc_cfgVars, i_idx, as_rqdNames))

getValueDouble

public final double getValueDouble(VWObject acosbsbc_cfgVars,
                                   int i_idx,
                                   String[] as_rqdNames)

Get the value of the desired configuration variable (which must have a particular name) as a double.

See getValueSB for parameter documentation.

Returns:
getValueDouble(getsb_sb_c(acosbsbc_cfgVars, i_idx, as_rqdNames))

getValueString

public final String getValueString(VWObject acosbsbc_cfgVars,
                                   int i_idx,
                                   String[] as_rqdNames)

Get the value of the desired configuration variable (which must have a particular name) as a string.

See getValueSB for parameter documentation.

Returns:
getValueString(getsb_sb_c(acosbsbc_cfgVars, i_idx, as_rqdNames))

getValueSB

public final StringBuffer getValueSB(VWObject acosbsbc_cfgVars,
                                     int i_idx,
                                     String[] as_rqdNames)

Get the value of the desired configuration variable (which must have a particular name) as a String.

Parameters:
acosbsbc_cfgVars - The VWObject containing the array configuration variables, in the form of sb_sb_c objects. May not be null or less than [i_idx + 1] elements in length.
i_idx - The index representing the desired element in both acosbsbc_cfgVars and as_rqdNames. May not be less than zero, or greater than the lesser of [acosbsbc_cfgVars.size() - 1] and [as_rqdNames.length - 1].
as_rqdNames - The array of required names. May not be null or less than [i_idx + 1] elements in length, and the i_idx-th element must equal the name of the i_idx-th element in acosbsbc_cfgVars.
Returns:
getValueSB(getsb_sb_c(acosbsbc_cfgVars, i_idx, as_rqdNames))



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