xbn.array.primitive
Class PASInt

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.util.XBNLocked
              |
              +--xbn.array.primitive.PrimitiveArray
                    |
                    +--xbn.array.primitive.PrimitiveArrayString
                          |
                          +--xbn.array.primitive.PASInt
All Implemented Interfaces:
LockOneWay

public class PASInt
extends PrimitiveArrayString
implements LockOneWay

As PrimitiveArrayString that wraps around an array of ints.

Source code:  PASInt.java.


Field Summary
static String sPASI
          To shorten code and Javadoc.
 
Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
PASInt()
          Create a PASInt with default values.
PASInt(int[] a_int)
          Create a PASInt.
PASInt(int[] a_int, boolean b_lock)
          Create a PASInt.
PASInt(int[] a_int, PARString par_string)
          Create a PASInt.
PASInt(String s_fqExtendingClass, int[] a_int)
          Create a PASInt.
PASInt(String s_fqExtendingClass, int[] a_int, boolean b_lock)
          Create a PASInt.
PASInt(String s_fqExtendingClass, int[] a_int, PARString par_string)
          Create a PASInt.
PASInt(String s_fqExtendingClass, int[] a_int, PARString par_string, boolean b_lock)
          Create an PASInt.
 
Method Summary
 int[] getAOInt()
          Get the int array for direct manipulation.
 int getLength()
          How many elements exist in this PASInt?
 PAIInt getPAIInt()
          Get a new PAIInt from the internally held int array.
 String getString(int i_dx)
          Get the (int translated to a) string at the requested array index.
 boolean isLocked()
          Is the value locked?
 boolean isNull()
          Is the array null?
 boolean isNull(int i_dx)
          Is the int at the requested array index null?
 void lock()
          Lock the value, forbidding further sets.
 
Methods inherited from class xbn.array.primitive.PrimitiveArrayString
areLmntsEqual, areLmntsEqual, getPARString, isValid
 
Methods inherited from class xbn.array.primitive.PrimitiveArray
areLmntsEqual, crashIfBad, crashIfBad, declareNoViolation, getFQClassName, getList, getList, getList, getList, getNewAOSOBString, getNewAOSOBStringBuffer, getNewAOString, getPAViolation, getPrimitiveArrayRule, getSOBString, getSOBStringBuffer, isValid, setPAViolation, throwAXIllegal, throwLmntsEqualAioobx, wasValidated
 
Methods inherited from class xbn.util.XBNLocked
throwLX, throwLX, throwLXIfLocked, throwLXIfLocked, throwLXIfLocked, throwLXIfUnlocked
 
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, toString, wait, wait, wait
 

Field Detail

sPASI

public static final String sPASI

To shorten code and Javadoc.

Equal to "xbn.array.primitive.PASInt"

Constructor Detail

PASInt

public PASInt()

Create a PASInt with default values.

Equal to PASInt(null)


PASInt

public PASInt(int[] a_int)

Create a PASInt.

Equal to PASInt(sPASI, a_int)


PASInt

public PASInt(String s_fqExtendingClass,
              int[] a_int)

Create a PASInt.

Equal to PASInt(s_fqExtendingClass, a_int, (new PARString())))


PASInt

public PASInt(int[] a_int,
              PARString par_string)

Create a PASInt.

Equal to PASInt(sPASI, a_int, par_string)


PASInt

public PASInt(String s_fqExtendingClass,
              int[] a_int,
              PARString par_string)

Create a PASInt.

Equal to PASInt(s_fqExtendingClass, a_int, par_string, false)


PASInt

public PASInt(int[] a_int,
              boolean b_lock)

Create a PASInt.

Equal to PASInt(sPASI, a_int, (new PARString()), b_lock)


PASInt

public PASInt(String s_fqExtendingClass,
              int[] a_int,
              boolean b_lock)

Create a PASInt.

Equal to PASInt(s_fqExtendingClass, a_int, (new PARString()), b_lock)


PASInt

public PASInt(String s_fqExtendingClass,
              int[] a_int,
              PARString par_string,
              boolean b_lock)

Create an PASInt.

The first line of this constructor calls PrimitiveArrayInt(s_fqExtendingClass, par_string)

Parameters:
a_int - The array of ints to analyze.
b_lock - Should a_int be directly accessible via getAOInt? If true, yes. If false, no.
Method Detail

getAOInt

public final int[] getAOInt()

Get the int array for direct manipulation.

Returns:
a_int Exactly as provided to the constructor.
Throws:
LockedException - If isLocked equals true.

getString

public final String getString(int i_dx)

Get the (int translated to a) string at the requested array index.

Overrides:
getString in class PrimitiveArray
Parameters:
i_dx - The array index. Must range 0..[getLength() - 1], inclusive

getLength

public final int getLength()

How many elements exist in this PASInt?

Overrides:
getLength in class PrimitiveArray
Returns:
a_int.length Where a_int is exactly as provided to the constructor.
Throws:
AssertException - If isNull equals true.

isNull

public final boolean isNull()

Is the array null?

Overrides:
isNull in class PrimitiveArray
Returns:
(a_int == null) Where a_int is exactly as provided to the constructor.

isNull

public final boolean isNull(int i_dx)

Is the int at the requested array index null?

Overrides:
isNull in class PrimitiveArray
Returns:
false An int can never be null.

getPAIInt

public final PAIInt getPAIInt()

Get a new PAIInt from the internally held int array.

Returns:
(new PAIInt(getFQClassName(),aInt, isLocked()))

lock

public final void lock()
Description copied from interface: LockOneWay

Lock the value, forbidding further sets. There is no way to unlock the value, so consider this function a "one way ticket".

It is recommended to crash if the value is already locked (isLocked is true). You must crash in your class' "set" functions when isLocked is true.

Specified by:
lock in interface LockOneWay
Following copied from interface: xbn.util.LockOneWay
Throws:
AssertException - If isLocked is true.

isLocked

public final boolean isLocked()
Description copied from interface: LockOneWay

Is the value locked?

Specified by:
isLocked in interface LockOneWay
Following copied from interface: xbn.util.LockOneWay
Returns:
true If lock has been called at some moment before now. This indicates that the value is locked and may no longer be altered.
false If lock has not yet been called. This indicates that the value may still be altered.



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