xbn.string.padchop
Class PCSConfig

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.string.padchop.PCSConfig
Direct Known Subclasses:
ConfigChop, ConfigPad

public class PCSConfig
extends XBNObject

Holds and manages configuration for a PadChopString. See PadChopString.

Source code:  PCSConfig.java.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
PCSConfig(int i_length)
          Create a PCSConfig.
PCSConfig(int i_length, SpcfcCfgChop sc_chop, SpcfcCfgPad sc_pad)
          Create a PCSConfig.
PCSConfig(int i_length, SpcfcCfgChop sc_chop, SpcfcCfgPad sc_pad, SpcfcCfgIfNull sc_ifNull)
          Create a PCSConfig.
 
Method Summary
 boolean doChop()
          If the string's length exceeds getLength, should it it be chopped?.
 boolean doPad()
          If the string's length does not meet getLength, should it it be padded?.
 int getLength()
          What is the length to pad/chop to?
 SpcfcCfgChop getSpcfcCfgChop()
          Get the SpcfcCfgChop for direct manipulation.
 SpcfcCfgIfNull getSpcfcCfgIfNull()
          Get the SpcfcCfgIfNull for direct manipulation.
 SpcfcCfgPad getSpcfcCfgPad()
          Get the SpcfcCfgPad for direct manipulation.
 void setLength(int i_length)
          Set the length to pad/chop to.
 void setSpcfcCfgChop(SpcfcCfgChop sc_chop)
          Set the SpcfcCfgChop.
 void setSpcfcCfgIfNull(SpcfcCfgIfNull sc_ifNull)
          Set the SpcfcCfgIfNull.
 void setSpcfcCfgPad(SpcfcCfgPad sc_pad)
          Set the SpcfcCfgPad.
 String toString()
          Get some information about this PadChopString.
 
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

PCSConfig

public PCSConfig(int i_length)

Create a PCSConfig.

Equal to PCSConfig(i_length, (new SpcfcCfgChop()), (new SpcfcCfgPad()))


PCSConfig

public PCSConfig(int i_length,
                 SpcfcCfgChop sc_chop,
                 SpcfcCfgPad sc_pad)

Create a PCSConfig.

Equal to PCSConfig(i_length, sc_chop, sc_pad, (new SpcfcCfgIfNull()))


PCSConfig

public PCSConfig(int i_length,
                 SpcfcCfgChop sc_chop,
                 SpcfcCfgPad sc_pad,
                 SpcfcCfgIfNull sc_ifNull)

Create a PCSConfig.

Parameters:
i_length - The length to chop or pad to. Must be greater than zero. See getLength and setLength.
sc_chop - The chop-specific configuration. If null, chopping does not occur. See getSpcfcCfgChop and setSpcfcCfgChop.
sc_pad - The pad-specific configuration. If null, padding does not occur. See getSpcfcCfgPad and setSpcfcCfgPad.
sc_ifNull - The crash-if-null-specific configuration. May not be null. See getSpcfcCfgIfNull and setSpcfcCfgIfNull.
Method Detail

getLength

public final int getLength()

What is the length to pad/chop to?

Returns:
i_length Exactly as provided to setLength.

doChop

public final boolean doChop()

If the string's length exceeds getLength, should it it be chopped?. See getLength

Returns:
(getSpcfcCfgChop() != null)

doPad

public final boolean doPad()

If the string's length does not meet getLength, should it it be padded?. See getLength

Returns:
(getSpcfcCfgPad() != null)

getSpcfcCfgChop

public final SpcfcCfgChop getSpcfcCfgChop()

Get the SpcfcCfgChop for direct manipulation.

The existence of this object declares that chopping will take place. See doChop.

Returns:
sc_chop Exactly as provided to setSpcfcCfgChop.

getSpcfcCfgPad

public final SpcfcCfgPad getSpcfcCfgPad()

Get the SpcfcCfgPad for direct manipulation.

The existence of this object declares that padding will take place. See doPad.

Returns:
sc_pad Exactly as provided to setSpcfcCfgPad.

getSpcfcCfgIfNull

public final SpcfcCfgIfNull getSpcfcCfgIfNull()

Get the SpcfcCfgIfNull for direct manipulation.

Returns:
pcs_IfNullCfg Exactly as provided to setSpcfcCfgIfNull.

setSpcfcCfgChop

public final void setSpcfcCfgChop(SpcfcCfgChop sc_chop)

Set the SpcfcCfgChop.

Get with getSpcfcCfgChop.

Parameters:
sc_chop - The chop-specific configuration. If null, chopping does not occur.

setSpcfcCfgPad

public final void setSpcfcCfgPad(SpcfcCfgPad sc_pad)

Set the SpcfcCfgPad.

Get with getSpcfcCfgPad.

Parameters:
sc_pad - The pad-specific configuration. If null, padding does not occur.

setSpcfcCfgIfNull

public final void setSpcfcCfgIfNull(SpcfcCfgIfNull sc_ifNull)

Set the SpcfcCfgIfNull.

Get with getSpcfcCfgIfNull.

Parameters:
sc_ifNull - The crash-if-null-specific configuration. May not be null.

setLength

public final void setLength(int i_length)

Set the length to pad/chop to.

Get with getLength

Parameters:
i_length - The length to chop or pad to. Must be greater than zero.

toString

public String toString()

Get some information about this PadChopString.

Overrides:
toString in class Object



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