xbn.array.primitive
Class PAIInt

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

public class PAIInt
extends PrimitiveArrayInt
implements LockOneWay

A PrimitiveArrayInt that wraps around an array of ints.

Source code:  PAIInt.java


Field Summary
static String sPAII
          To shorten code and Javadoc.
 
Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
PAIInt()
          Create a PAIInt with default values.
PAIInt(int[] a_int)
          Create a PAIInt.
PAIInt(int[] a_int, boolean b_lock)
          Create a PAIInt.
PAIInt(int[] a_int, PARInt par_int)
          Create a PAIInt.
PAIInt(String s_fqExtendingClass, int[] a_int)
          Create a PAIInt.
PAIInt(String s_fqExtendingClass, int[] a_int, boolean b_lock)
          Create a PAIInt.
PAIInt(String s_fqExtendingClass, int[] a_int, PARInt par_int)
          Create a PAIInt.
PAIInt(String s_fqExtendingClass, int[] a_int, PARInt par_int, boolean b_lock)
          Create an PAIInt.
 
Method Summary
 int[] getAOInt()
          Get the array of ints for direct manipulation.
 int getInt(int i_dx)
          Get the int at the requested array index.
 int getLength()
          How many elements are in this PAIInt?
 PASInt getPASInt()
          Get a PASInt containing the same int array as exists in this class.
 boolean isLocked()
          Is the value locked?
 boolean isNull()
          Is the int array null?
 boolean isNull(int i_dx)
          Is the char at the requested array index null?
 void lock()
          Lock the value, forbidding further sets.
 
Methods inherited from class xbn.array.primitive.PrimitiveArrayInt
areLmntsEqual, areLmntsEqual, getMaximum, getMinimum, getPARInt, getString, 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

sPAII

public static final String sPAII

To shorten code and Javadoc.

Equal to "xbn.array.primitive.PAIInt"

Constructor Detail

PAIInt

public PAIInt()

Create a PAIInt with default values.

Equal to PAIInt(null)


PAIInt

public PAIInt(int[] a_int)

Create a PAIInt.

Equal to PAIInt(sPAII, a_int)


PAIInt

public PAIInt(String s_fqExtendingClass,
              int[] a_int)

Create a PAIInt.

Equal to PAIInt(s_fqExtendingClass, a_int, (new PARInt()))


PAIInt

public PAIInt(int[] a_int,
              PARInt par_int)

Create a PAIInt.

Equal to PAIInt(sPAII, a_int)


PAIInt

public PAIInt(String s_fqExtendingClass,
              int[] a_int,
              PARInt par_int)

Create a PAIInt.

Equal to PAIInt(s_fqExtendingClass, a_int, par_int)


PAIInt

public PAIInt(int[] a_int,
              boolean b_lock)

Create a PAIInt.

Equal to PAIInt(sPAII, a_int, (new PARInt()), b_lock)


PAIInt

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

Create a PAIInt.

Equal to PAIInt(s_fqExtendingClass, a_int, (new PARInt()), b_lock)


PAIInt

public PAIInt(String s_fqExtendingClass,
              int[] a_int,
              PARInt par_int,
              boolean b_lock)

Create an PAIInt.

Equal to PrimitiveArrayInt(s_fqExtendingClass, par_int)

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

getAOInt

public int[] getAOInt()

Get the array of ints for direct manipulation.

Returns:
a_int Exactly as provided to the constructor.

getInt

public int getInt(int i_dx)

Get the int at the requested array index.

Overrides:
getInt in class PrimitiveArrayInt
Parameters:
i_dx - The array index. Must range 0..[getLength() - 1], inclusive
Throws:
AssertException - If isNull equals true.

getLength

public int getLength()

How many elements are in this PAIInt?

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 boolean isNull()

Is the int array null?

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

isNull

public boolean isNull(int i_dx)

Is the char at the requested array index null?

Overrides:
isNull in class PrimitiveArray
Returns:
false It is not possible for a char to be null.

getPASInt

public final PASInt getPASInt()

Get a PASInt containing the same int array as exists in this class.

Returns:
(new PASInt(a_int, isLocked())) Where a_int is exactly as passed into the constructor.

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