xbn.util
Class RCLength

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.util.RangeConfig
              |
              +--xbn.util.RCLength

public class RCLength
extends RangeConfig

A RangeConfig where the minimum value is always enforced, and may never be lower than zero. This class is helpful when validating something that has length. To manage a number conforming to an RCLength, see RLength.

Source code:  RCLength.java.  Unit tests:  xbn_junit.JUTRCLength.java.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
RCLength()
          Create a, completely unrestricted, RCLength object.
RCLength(int i_max)
          Create a RCLength.
RCLength(int i_max, boolean b_nfrcMax)
          Create a RCLength.
RCLength(int i_min, int i_max)
          Create a RCLength.
RCLength(int i_min, int i_max, boolean b_nfrcMax)
          Create a RCLength.
RCLength(RCLength rc_length)
          Create a copy of the provided RCLength.
 
Method Summary
 boolean isRestricted()
          Are there any restrictions imposed by this RCLength?
 String toString()
          Get some information about this RCLength.
 String toString(boolean b_className)
          Get some information about this RCLength.
 
Methods inherited from class xbn.util.RangeConfig
getMax, getMin, isMaxEnforced, isMinEnforced, isValid
 
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

RCLength

public RCLength()

Create a, completely unrestricted, RCLength object.

Equal to RCLength(0, -1, false)


RCLength

public RCLength(int i_max)

Create a RCLength.

Equal to RCLength(i_min, i_max)


RCLength

public RCLength(int i_min,
                int i_max)

Create a RCLength.

Equal to RCLength(i_min, i_max, true)


RCLength

public RCLength(int i_max,
                boolean b_nfrcMax)

Create a RCLength.

Equal to RCLength(0, i_max, b_nfrcMax)


RCLength

public RCLength(int i_min,
                int i_max,
                boolean b_nfrcMax)

Create a RCLength.

Equal to RangeConfig(i_min, true, i_max, b_nfrcMax). After this super call is successful, it is then verified that i_min is less than zero.


RCLength

public RCLength(RCLength rc_length)

Create a copy of the provided RCLength.

Equal to RangeConfig(rc_length)

Method Detail

isRestricted

public boolean isRestricted()

Are there any restrictions imposed by this RCLength?

Overrides:
isRestricted in class RangeConfig
Returns:
(getMin() > 0 || isMaxEnforced())

toString

public String toString()

Get some information about this RCLength.

Equal to toString(true)

Overrides:
toString in class RangeConfig

toString

public String toString(boolean b_className)

Get some information about this RCLength.

Overrides:
toString in class RangeConfig
Parameters:
b_className - If true, display the class name at the beginning of the returned string. If false, don't.



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