xbn.array.primitive
Class PARChar

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.array.primitive.PrimitiveArrayRule
              |
              +--xbn.array.primitive.PARChar
Direct Known Subclasses:
PARCGoodUnq

public class PARChar
extends PrimitiveArrayRule

Defines the rules to be enforced by PrimitiveArrayChar.isValid. See PrimitiveArrayChar.isValid.

Source code:  PARChar.java.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
PARChar()
          Create a completely unrestricted PARChar.
PARChar(char[] ac_illegal)
          Create a PARChar.
PARChar(PARChar par_char)
          Create a full (deep) copy of the provided PARChar.
PARChar(PARDupNullLen par_dupNullLen)
          Create a PARChar.
PARChar(PARDupNullLen par_dupNullLen, char[] ac_illegal)
          Create a PARChar.
PARChar(PARDupNullLen par_dupNullLen, PAROrderDir par_orderDir)
          Create a PARChar.
PARChar(PARDupNullLen par_dupNullLen, PAROrderDir par_orderDir, char[] ac_illegal)
          Create an PARCGoodUnq.
PARChar(PAROrderDir par_orderDir)
          Create a PARChar.
PARChar(PAROrderDir par_orderDir, char[] ac_illegal)
          Create a PARChar.
 
Method Summary
 APChar getAPCIllegal()
          Get the array of chars considered illegal, as an APChar.
 boolean hasIllegalChars()
          Is there at least one int considered illegal?
 boolean isIllegal(char c_har)
          Is the provided char illegal?
 boolean isRestricted()
          Does this PARChar have any restrictions?
 String toString()
          Get some information about this PARChar.
 
Methods inherited from class xbn.array.primitive.PrimitiveArrayRule
getPARDupNullLen, getPAROrderDir
 
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

PARChar

public PARChar()

Create a completely unrestricted PARChar.

Equal to PARChar(new PARDupNullLen())

Using this constructor causes isRestricted to equal true (until values are subsequently altered).


PARChar

public PARChar(PARDupNullLen par_dupNullLen)

Create a PARChar.

Equal to PARChar(par_dupNullLen, (new PAROrderDir()))


PARChar

public PARChar(PAROrderDir par_orderDir)

Create a PARChar.

Equal to PARChar((new PARDupNullLen()), par_orderDir)


PARChar

public PARChar(char[] ac_illegal)

Create a PARChar.

Equal to PARChar((new PARDupNullLen()), ac_illegal)


PARChar

public PARChar(PARDupNullLen par_dupNullLen,
               PAROrderDir par_orderDir)

Create a PARChar.

Equal to PARChar(par_dupNullLen, par_orderDir, (new char[] {}))


PARChar

public PARChar(PARDupNullLen par_dupNullLen,
               char[] ac_illegal)

Create a PARChar.

Equal to PARChar(par_dupNullLen, (new PAROrderDir()), ac_illegal)


PARChar

public PARChar(PAROrderDir par_orderDir,
               char[] ac_illegal)

Create a PARChar.

Equal to PARChar((new PARDupNullLen()), par_dupNullLen, par_orderDir, ac_illegal)


PARChar

public PARChar(PARDupNullLen par_dupNullLen,
               PAROrderDir par_orderDir,
               char[] ac_illegal)

Create an PARCGoodUnq.

The first line of this constructor calls PrimitiveArrayRule(par_dupNullLen, par_orderDir).

Parameters:
ac_illegal - Contains all chars considered illegal. Note that this is sorted in this constructor. May not be null. If zero elements in length, no chars are considered illegal.

PARChar

public PARChar(PARChar par_char)

Create a full (deep) copy of the provided PARChar.

The first line of this constructor calls PrimitiveArrayRule(par_char)

Method Detail

getAPCIllegal

public final APChar getAPCIllegal()

Get the array of chars considered illegal, as an APChar.

Returns:
(new APChar(ac_illegal)) Where ac_illegal is exactly as provided to the constructor (except that it is sorted). Note this object is only created once.

hasIllegalChars

public final boolean hasIllegalChars()

Is there at least one int considered illegal?

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

isIllegal

public boolean isIllegal(char c_har)

Is the provided char illegal?

Parameters:
c_har - The char to determine legality of. May not be null.
Returns:
(Arrays.binarySearch(ac_illegal, c_har) > -1) Where ac_illegal is exactly as provided to the constructor.

isRestricted

public boolean isRestricted()

Does this PARChar have any restrictions?

Overrides:
isRestricted in class PrimitiveArrayRule
Returns:
(super.isRestricted() || getAPCIllegal().getLength() > 0)

toString

public String toString()

Get some information about this PARChar.

Overrides:
toString in class PrimitiveArrayRule



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