xbn.array.primitive
Class PrimitiveArrayInt

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.util.XBNLocked
              |
              +--xbn.array.primitive.PrimitiveArray
                    |
                    +--xbn.array.primitive.PrimitiveArrayInt
Direct Known Subclasses:
PAIInt

public abstract class PrimitiveArrayInt
extends PrimitiveArray

A PrimitiveArray for ints.

Source code:  PrimitiveArrayInt.java.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
protected PrimitiveArrayInt(String s_fqExtendingClass, PARInt par_int)
          Create an PrimitiveArrayInt.
 
Method Summary
 boolean areLmntsEqual(int i_idxThis, PrimitiveArray pa_other, int i_idxOther)
          Are the two elements equal?
 boolean areLmntsEqual(int i_idxThis, PrimitiveArrayInt pai_other, int i_idxOther)
          Is an element in this PrimitiveArrayInt equal to an element in another?
abstract  int getInt(int i_dx)
          Get the int at the requested array index.
 int getMaximum()
          What is the maximum value contained in the array?
 int getMinimum()
          What is the minimum value contained in the array?
 PARInt getPARInt()
          Get the PARInt for direct manipulation.
 String getString(int i_dx)
          Get the element at the requested array index, as a string.
 boolean isValid(String s_callingClsFnc, String s_varName)
          Is the [object wrapped to look like an array of ints] legal?
 
Methods inherited from class xbn.array.primitive.PrimitiveArray
areLmntsEqual, crashIfBad, crashIfBad, declareNoViolation, getFQClassName, getLength, getList, getList, getList, getList, getNewAOSOBString, getNewAOSOBStringBuffer, getNewAOString, getPAViolation, getPrimitiveArrayRule, getSOBString, getSOBStringBuffer, isNull, isNull, 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
 

Constructor Detail

PrimitiveArrayInt

protected PrimitiveArrayInt(String s_fqExtendingClass,
                            PARInt par_int)

Create an PrimitiveArrayInt.

The first line of this constructor calls PrimitiveArray(s_fqExtendingClass, par_int)

Parameters:
par_int - Defines the rules to be enforced by isValid. May not be null. See getPARInt.
Method Detail

getInt

public abstract int getInt(int i_dx)

Get the int at the requested array index.

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

getString

public final String getString(int i_dx)
Description copied from class: PrimitiveArray

Get the element at the requested array index, as a string.

Overrides:
getString in class PrimitiveArray
Returns:
(new Integer(getInt(i_dx))).toString()

areLmntsEqual

public final boolean areLmntsEqual(int i_idxThis,
                                   PrimitiveArray pa_other,
                                   int i_idxOther)
Description copied from class: PrimitiveArray

Are the two elements equal?

Overrides:
areLmntsEqual in class PrimitiveArray
Following copied from class: xbn.array.primitive.PrimitiveArray
Parameters:
i_idxThis - The array index. Must range 0..[getLength() - 1], inclusive
pa_other - The PrimitiveArray to retrieve element i_idxOther from. May not be null.
i_idxOther - The array index of the desired element in pa_other. Must be valid for pa_other.

areLmntsEqual

public final boolean areLmntsEqual(int i_idxThis,
                                   PrimitiveArrayInt pai_other,
                                   int i_idxOther)

Is an element in this PrimitiveArrayInt equal to an element in another?

For documentation on this function, see PrimitiveArray.areLmntsEqual.


getPARInt

public final PARInt getPARInt()

Get the PARInt for direct manipulation.

Returns:
(PARInt)constructor.

isValid

public final boolean isValid(String s_callingClsFnc,
                             String s_varName)

Is the [object wrapped to look like an array of ints] legal?

Overrides:
isValid in class PrimitiveArray
Parameters:
s_callingClsFnc - The name of the class-dot-function for use in potential error messages only. This is the place where the error message should appear that it was generated from. For example: xbn.util.PrimitiveArrayInt.crashIfInvalid.
s_varName - The descriptive name of the int array, for potential error messages only.
Returns:
true If all rules configured into the PARInt are followed by the [object wrapped to look like an array of ints].
false If any rules are violated.

getMaximum

public final int getMaximum()

What is the maximum value contained in the array?

Throws:
AssertException - If isNull equals true.

getMinimum

public final int getMinimum()

What is the minimum value contained in the array?

Throws:
AssertException - If isNull equals true.



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