xbn.array.primitive
Class PARIElement

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

public class PARIElement
extends XBNObject
implements Cloneable

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

Source code:  PARIElement.java


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
PARIElement()
          Create an unrestricted PARIElement.
PARIElement(int[] ai_illegal)
          Create a PARIElement.
PARIElement(RangeConfig range_config)
          Create a PARIElement.
PARIElement(RangeConfig range_config, int[] ai_illegal)
          Create a PARIElement.
 
Method Summary
protected  Object clone()
          Get a full (deep) copy of this PARIElement as an Object.
 APInt getAPIIllegal()
          Get the array of strings considered illegal, as an APInt.
 PARIElement getPARIEClone()
          Get a full (deep) copy of this PARIElement.
 RangeConfig getRangeConfig()
          What character is defined as illegal, should it be found in the char array?
 boolean hasIllegalInts()
          Is there at least one int considered illegal?
 boolean isIllegal(int i_nt)
          Is the provided int illegal?
 boolean isRestricted()
          Does this PARIElement have any restrictions?
 String toString()
          Get some information about this PARIElement.
 
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

PARIElement

public PARIElement()

Create an unrestricted PARIElement.

Equal to PARIElement(new RangeConfig())


PARIElement

public PARIElement(RangeConfig range_config)

Create a PARIElement.

Equal to PARIElement(range_config, (new int[] {}))


PARIElement

public PARIElement(int[] ai_illegal)

Create a PARIElement.

Equal to PARIElement((new RangeConfig()), ai_illegal)


PARIElement

public PARIElement(RangeConfig range_config,
                   int[] ai_illegal)

Create a PARIElement.

Parameters:
range_config - The RangeConfig to impose onto every value in the int array. May not be null.
ai_illegal - Contains all ints considered illegal. Note that this is sorted in this constructor. May not be null. If zero elements in length, no ints are considered illegal.
Method Detail

getRangeConfig

public final RangeConfig getRangeConfig()

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

Returns:
range_config Exactly as provided to the constructor.

isIllegal

public boolean isIllegal(int i_nt)

Is the provided int illegal?

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

hasIllegalInts

public final boolean hasIllegalInts()

Is there at least one int considered illegal?

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

getAPIIllegal

public final APInt getAPIIllegal()

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

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

isRestricted

public boolean isRestricted()

Does this PARIElement have any restrictions?

Returns:
(getRangeConfig().isRestricted()  ||  hasIllegalInts())

toString

public String toString()

Get some information about this PARIElement.

Overrides:
toString in class Object

getPARIEClone

public final PARIElement getPARIEClone()

Get a full (deep) copy of this PARIElement.

Returns:
(PARIElement)clone()

clone

protected final Object clone()
                      throws CloneNotSupportedException

Get a full (deep) copy of this PARIElement 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