xbn.array.primitive
Class PARSContain

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.array.primitive.PARSContain
Direct Known Subclasses:
PARSCBad

public class PARSContain
extends XBNObject

Defines rules regarding containment and equality between array elements. Containment is defined as "element X fully exists in element Y, but is not equal to element Y".

Source code:  PARSContain.java


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
  PARSContain()
          Create a PARSContain with default values.
  PARSContain(boolean b_containmentOk)
          Create a PARSContain.
  PARSContain(boolean b_rdrdContainment, boolean b_orderDirAscDesc)
          Create a PARSContain.
protected PARSContain(boolean b_containmentOk, boolean b_rdrdContainment, boolean b_orderDirAscDesc)
          Create a PARSContain.
 
Method Summary
 boolean getOrderDirAscDesc()
          What direction should containment be in?
 boolean isContainmentOk()
          Is it okay for the array to have a value that contains another?.
 boolean isRestricted()
          Does this PARSContain have any restrictions?
 boolean mustBeOrdered()
          Must containment be in a certain order?
 String toString()
          Get some information about this PARSContain.
 
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

PARSContain

public PARSContain()

Create a PARSContain with default values.

Equal to PARSContain(true)


PARSContain

public PARSContain(boolean b_containmentOk)

Create a PARSContain.

Equal to PARSContain(b_containmentOk, false, false)


PARSContain

public PARSContain(boolean b_rdrdContainment,
                   boolean b_orderDirAscDesc)

Create a PARSContain.

Equal to PARSContain(false, b_rdrdContainment, b_orderDirAscDesc)


PARSContain

protected PARSContain(boolean b_containmentOk,
                      boolean b_rdrdContainment,
                      boolean b_orderDirAscDesc)

Create a PARSContain.

Parameters:
b_containmentOk - If true, then values may contain one another. If false, no value may be contained in another. See isContainmentOk.
b_rdrdContainment - Must containment be ordered? If true, then yes (direction is defined by b_orderDirAscDesc). If false, no. When b_containmentOk is true, this must equal false. See mustBeOrdered.
b_orderDirAscDesc - What direction should containment ordering be in? If true, then ascending (0, 1, 2, ...), otherwise, descending. When b_rdrdContainment is false, this is ignored. See getOrderDirAscDesc.
Method Detail

isContainmentOk

public final boolean isContainmentOk()

Is it okay for the array to have a value that contains another?. Note that if two elements are equal, they are not "contained" in one another.

Returns:
b_containmentOk Exactly as provided to the constructor.

mustBeOrdered

public final boolean mustBeOrdered()

Must containment be in a certain order?

If this returns true, then containment is ordered (direction is defined by getOrderDirAscDesc). If false, containment is not ordered.

Returns:
b_rdrdContainment Exactly as provided to the constructor. Exception: When isContainmentOk equals true, this always returns false..

getOrderDirAscDesc

public final boolean getOrderDirAscDesc()

What direction should containment be in?

If this function returns true, then ordering must be ascending (0, 1, 2, ...), meaning element 0 may be contained by element 3, but not vice-versa. If this function returns false, then containment must be descending.

Returns:
b_orderDirAscDesc Exactly as provided to the constructor. Exception: When mustBeOrdered equals false, this always returns false..

isRestricted

public final boolean isRestricted()

Does this PARSContain have any restrictions?

Returns:
!isContainmentOk()

toString

public final String toString()

Get some information about this PARSContain.

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