xbn.array.primitive
Class PrimitiveArrayChar

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

public abstract class PrimitiveArrayChar
extends PrimitiveArray

A PrimitiveArray for chars.

Source code:  PrimitiveArrayChar.java.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
protected PrimitiveArrayChar(String s_fqExtendingClass, PARChar par_char)
          Create an PrimitiveArrayChar.
 
Method Summary
 boolean areLmntsEqual(int i_idxThis, PrimitiveArrayChar pac_other, int i_idxOther)
          Is an element in this PrimitiveArrayChar equal to an element in another?
 boolean areLmntsEqual(int i_idxThis, PrimitiveArray pa_other, int i_idxOther)
          Are the two elements equal?
abstract  char getChar(int i_dx)
          Get the char at the requested array index.
 PARChar getPARChar()
          Get the PARChar 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 chars] 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

PrimitiveArrayChar

protected PrimitiveArrayChar(String s_fqExtendingClass,
                             PARChar par_char)

Create an PrimitiveArrayChar.

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

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

getChar

public abstract char getChar(int i_dx)

Get the char 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 Character(getChar(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 boolean areLmntsEqual(int i_idxThis,
                             PrimitiveArrayChar pac_other,
                             int i_idxOther)

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

For documentation on this function, see PrimitiveArray.areLmntsEqual.


getPARChar

public final PARChar getPARChar()

Get the PARChar for direct manipulation.

Returns:
(PARChar)getPrimitiveArrayRule().

isValid

public final boolean isValid(String s_callingClsFnc,
                             String s_varName)

Is the [object wrapped to look like an array of chars] 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.array.primitive.PrimitiveArrayChar.crashIfInvalid.
s_varName - The descriptive name of the char array, for potential error messages only.
Returns:
true If all rules configured into the PARChar are followed by the [object wrapped to look like an array of chars].
false If any rules are violated. Note, when either s_callingClsFnc and/or s_varName are non-null, this instead will throw an AssertException.



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