xbn.array.primitive
Class PARSElement

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.array.primitive.PARSElement
All Implemented Interfaces:
Cloneable

public class PARSElement
extends XBNObject
implements Cloneable

Part of PARString configuring element-related items. See PARString.

Source code:  PARSElement.java


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
PARSElement()
          Create an unrestricted PARSElement.
PARSElement(boolean b_lmntNullOk)
          Create a PARSElement.
PARSElement(boolean b_lmntNullOk, RCLength rcl_lmntLength)
          Create a PARSElement with the element-null setting and RCLength.
PARSElement(boolean b_lmntNullOk, RCLength rcl_lmntLength, String[] as_illegal)
          Create a PARSElement.
PARSElement(boolean b_lmntNullOk, String[] as_illegal)
          Create a PARSElement.
PARSElement(RCLength rcl_lmntLength)
          Create a PARSElement.
PARSElement(RCLength rcl_lmntLength, String[] as_illegal)
          Create a PARSElement.
PARSElement(String[] as_illegal)
          Create a PARSElement.
 
Method Summary
protected  Object clone()
          Get a full (deep) copy of this PARSElement as an Object.
 AOSLHashtable getAOSLHIllegal()
          Get the AOSLHashtable containing the strings considered illegal.
 APString getAPSIllegal()
          Get the array of strings considered illegal, as an APString.
 PARSElement getPARSEClone()
          Get a full (deep) copy of this PARSElement.
 RCLength getRCLength()
          What character is defined as illegal, should it be found in the char array?
 boolean hasIllegalStrings()
          Are there strings considered illegal?
 boolean isIllegal(String s_tr)
          Is the provided string illegal?
 boolean isNullLmntOk()
          Is a character defined as illegal, should it be found in the char array?
 boolean isRestricted()
          Does this PARSEIllegal have any restrictions?
 String toString()
          Get some information about this PARSEIllegal.
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PARSElement

public PARSElement()

Create an unrestricted PARSElement.

Equal to PARSElement(true)


PARSElement

public PARSElement(boolean b_lmntNullOk)

Create a PARSElement.

Equal to PARSElement(b_lmntNullOk, (new RCLength()))


PARSElement

public PARSElement(RCLength rcl_lmntLength)

Create a PARSElement.

Equal to PARSElement(true, rcl_lmntLength)


PARSElement

public PARSElement(String[] as_illegal)

Create a PARSElement.

Equal to PARSElement(true, as_illegal)


PARSElement

public PARSElement(boolean b_lmntNullOk,
                   RCLength rcl_lmntLength)

Create a PARSElement with the element-null setting and RCLength.

Equal to PARSElement(b_lmntNullOk, rcl_lmntLength, (new String[] {}))


PARSElement

public PARSElement(boolean b_lmntNullOk,
                   String[] as_illegal)

Create a PARSElement.

Equal to PARSElement(b_lmntNullOk, (new RCLength()), as_illegal)


PARSElement

public PARSElement(RCLength rcl_lmntLength,
                   String[] as_illegal)

Create a PARSElement.

Equal to PARSElement(true, rcl_lmntLength, as_illegal)


PARSElement

public PARSElement(boolean b_lmntNullOk,
                   RCLength rcl_lmntLength,
                   String[] as_illegal)

Create a PARSElement.

Parameters:
b_lmntNullOk - If true, then any element in the PrimitiveArrayString may be null. If false, then no element may be null.
rcl_lmntLength - The range that each element's length must conform to. May not be null.
as_illegal - The array of strings that no element may be equal to. May not be null. If zero elements in length, then no strings are considered illegal. If at least one element in length, then each element's length must be legal according to rcl_lmntLength.isValid. Duplicate strings in this array are ignored.
Method Detail

isNullLmntOk

public final boolean isNullLmntOk()

Is a character defined as illegal, should it be found in the char array?

Returns:
b_lmntNullOk Exactly as provided to the constructor.

getRCLength

public final RCLength getRCLength()

What character is defined as illegal, should it be found in the char array?

Returns:
rcl_lmntLength Exactly as provided to the constructor.

getAOSLHIllegal

public final AOSLHashtable getAOSLHIllegal()

Get the AOSLHashtable containing the strings considered illegal.

Returns:
An AOSLHashtable containing only those strings in as_illegal (as provided to the constructor) that are unique. If as_illegal.length() was zero, then this function will return null.

isIllegal

public boolean isIllegal(String s_tr)

Is the provided string illegal?

Parameters:
s_tr - The string to determine illegality of. May not be null.
Returns:
false if getAOSLHIllegal is null.
getAOSLHIllegal().containsKey(s_tr) If otherwise.

hasIllegalStrings

public final boolean hasIllegalStrings()

Are there strings considered illegal?

Returns:
(getAPSIllegal().getLength() > 0)

getAPSIllegal

public final APString getAPSIllegal()

Get the array of strings considered illegal, as an APString.

Returns:
(new APString(as_illegal)) Where ai_illegal is exactly as provided to the constructor. Note this object is only created once.

isRestricted

public boolean isRestricted()

Does this PARSEIllegal have any restrictions?

Returns:
(!isNullLmntOk() || getRCLength().isRestricted() || hasIllegalStrings())

toString

public String toString()

Get some information about this PARSEIllegal.

Overrides:
toString in class Object

getPARSEClone

public final PARSElement getPARSEClone()

Get a full (deep) copy of this PARSElement.

Returns:
(PARSElement)clone()

clone

protected final Object clone()
                      throws CloneNotSupportedException

Get a full (deep) copy of this PARSElement as an Object.

Overrides:
clone 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