xbn.array
Class APInt

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.array.ArrayProtector
              |
              +--xbn.array.APInt
All Implemented Interfaces:
Cloneable

public class APInt
extends ArrayProtector

An ArrayProtector for chars.

Source code:  APInt.java


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
APInt(int[] a_int)
          Create an APInt.
APInt(int[] a_int, boolean b_shallowCloneAOS)
          Create an APInt.
 
Method Summary
 void addToACInt(VWInt ac_int)
          Add the int-array-being-protected to the provided VWInt.
 int binarySearch(int i_nt)
          Return the array index at which the provided int exists.
protected  Object clone()
          Get a full (deep) copy of this APInt as an Object.
 boolean doesExistInSrtd(int i_nt)
          Does the provided int exist in the sorted int-array-being-protected?
 int[] getAOIClone()
          Get a full (deep) copy of the int-array-being-wrapped.
 APInt getAPIClone()
          Get a full (deep) copy of this APInt.
 int getInt(int i_dx)
          Get the int at the requested array index.
 int getLength()
          How many elements exist in the array-being-protected?
 PAIInt getPAIInt()
          Get a new PAIInt wrapping around the char-array-being-protected.
 String getString(int i_dx)
           
 boolean isNull()
          As a whole, is the array-being-protected null?
 boolean isNull(int i_dx)
           
 String toString()
          Get some information about this ArrayProtector.
 
Methods inherited from class xbn.array.ArrayProtector
getList, getList, getList, getList, getPASArrayProtector
 
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

APInt

public APInt(int[] a_int)

Create an APInt.


APInt

public APInt(int[] a_int,
             boolean b_shallowCloneAOS)

Create an APInt.

Method Detail

isNull

public final boolean isNull()
Description copied from class: ArrayProtector

As a whole, is the array-being-protected null?

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

getLength

public final int getLength()
Description copied from class: ArrayProtector

How many elements exist in the array-being-protected?

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

getInt

public final int getInt(int i_dx)

Get the int at the requested array index.

Returns:
a_int[i_dx] Where a_int is exactly as provided to the constructor.

getString

public final String getString(int i_dx)
Overrides:
getString in class ArrayProtector

doesExistInSrtd

public final boolean doesExistInSrtd(int i_nt)

Does the provided int exist in the sorted int-array-being-protected?

Returns:
(binarySearch(i_nt) > -1)

binarySearch

public final int binarySearch(int i_nt)

Return the array index at which the provided int exists.

You must ensure that the a_char constructor parameter is properly sorted. Otherwise this function provides unpredictable results

Returns:
Arrays.binarySearch([INT-ARRAY-BEING-PROTECTED], i_nt)
Throws:
AssertException - If isNull equals true.

isNull

public final boolean isNull(int i_dx)
Overrides:
isNull in class ArrayProtector

addToACInt

public final void addToACInt(VWInt ac_int)

Add the int-array-being-protected to the provided VWInt.

If isNull equals true, nothing is done. If false, then ac_int.addArray([INTERNAL INT ARRAY]) is called.

Parameters:
ac_int - The VWInt to add to. May not be null.

getAOIClone

public final int[] getAOIClone()

Get a full (deep) copy of the int-array-being-wrapped.

Returns:
(new UtilArray()).getAOIClone(a_int) Where a_int is exactly as provided to the constructor. Note that this function only creates the clone once. Once created, the copy is then internally stored, and returned for all subsequent calls.

getPAIInt

public final PAIInt getPAIInt()

Get a new PAIInt wrapping around the char-array-being-protected.

Returns:
(new PAIInt(getAOIClone(), true))

toString

public String toString()
Description copied from class: ArrayProtector

Get some information about this ArrayProtector.

Overrides:
toString in class ArrayProtector

getAPIClone

public final APInt getAPIClone()

Get a full (deep) copy of this APInt.

Returns:
(APInt)clone()

clone

protected final Object clone()
                      throws CloneNotSupportedException

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

Overrides:
clone in class Object
Returns:
(new APInt(a_int)) Where a_int is exactly as provided to the constructor.



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