|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.array.CompareArrays
Compare the values in two PrimitiveArrays. See PrimitiveArray.
Source code: CompareArrays.java
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
CompareArrays()
Create a CompareArrays with default settings. |
|
CompareArrays(CAConfig ca_config)
Create a CompareArrays. |
Method Summary | |
void |
crashIfBadValues(PrimitiveArray pa_rqd,
PrimitiveArray pa_actual)
If the actual values are illegal crash with an explanation. |
void |
crashIfBadValues(String s_callingClsFnc,
String s_rqdName,
String s_actualName,
PrimitiveArray pa_rqd,
PrimitiveArray pa_actual)
If the actual values are illegal crash with an explanation. |
boolean |
doAssumePAActlValid()
Should it be assumed (by hasRqdValues) that the actual PrimitiveArray is (individually) valid and ready for comparison? |
boolean |
doAssumePARqdValid()
Should it be assumed (by hasRqdValues) that the required PrimitiveArray is (individually) valid and ready for comparison? |
boolean |
doAssumePAsValid()
Should it be assumed (by hasRqdValues) that both the required and actual PrimitiveArrays are (individually) valid and ready for comparison? |
CAConfig |
getCAConfig()
Get the CAConfig for direct maniplation. |
boolean |
hasRqdValues(PrimitiveArray pa_rqd,
PrimitiveArray pa_actual)
Are the actual values legal, according to both the rules in CAConfig and the "required" values? |
boolean |
hasRqdValues(String s_callingClsFnc,
String s_rqdName,
String s_actualName,
PrimitiveArray pa_rqd,
PrimitiveArray pa_actual)
Are the actual values legal, according to both the rules in CAConfig and the "required" values? |
void |
setAssumePAActlValid(boolean b_assumePAActlValid)
Declare if it should be assumed (by hasRqdValues) that the actual PrimitiveArray is (individually) valid and ready for comparison. |
void |
setAssumePARqdValid(boolean b_assumePARqdValid)
Declare if it should be assumed (by hasRqdValues) that the required PrimitiveArray is (individually) valid and ready for comparison. |
void |
setAssumePAsValid(boolean b_assumePAsValid)
Declare if it should be assumed (by hasRqdValues) that both the required and actual PrimitiveArrays are (individually) valid and ready for comparison. |
protected void |
throwAXBad(String s_callingClsFnc,
String s_actualName,
PrimitiveArray pa_rqd,
PrimitiveArray pa_actual,
String s_currently)
Used internally, by hasRqdValues. |
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 |
public CompareArrays()
Create a CompareArrays with default settings.
Equal to CompareArrays(new CAConfig())
public CompareArrays(CAConfig ca_config)
Create a CompareArrays.
ca_config
- Defines the rules used when comparing the two PrimitiveArrays. May not be null. See getCAConfig.Method Detail |
public CAConfig getCAConfig()
Get the CAConfig for direct maniplation.
public final void setAssumePAsValid(boolean b_assumePAsValid)
Declare if it should be assumed (by hasRqdValues) that both the required and actual PrimitiveArrays are (individually) valid and ready for comparison. See hasRqdValues and PrimitiveArray.wasValidated.
Get with doAssumePAsValid.
hasRqdValues expects that both pa_rqd.wasValidated()
and pa_actual.wasValidated()
equal true and pa_rqd.getPrimitiveArrayRule().getPARDupNullLen().areDupsOk()
, pa_rqd.getPrimitiveArrayRule().getPARDupNullLen().isNullOk()
and pa_actual.getPrimitiveArrayRule().getPARDupNullLen().isNullOk()
all equal false.
If pa_actual and pa_rqd are both definitely valid--you knew this before you even created the PrimitiveArrays--then don't waste time validating them. Just call this function with "true", and the hasRqdValues function will just assume that the above requirements have been met, without checking. Understand you will get unpredictable results if you use this function but shouldn't.
This function first calls setAssumePARqdValid(b_assumePAsValid)
and then setAssumePAActlValid(b_assumePAsValid)
public final boolean doAssumePAsValid()
Should it be assumed (by hasRqdValues) that both the required and actual PrimitiveArrays are (individually) valid and ready for comparison?
Set with setAssumePAsValid.
(doAssumePARqdValid() && doAssumePAActlValid())
public final void setAssumePARqdValid(boolean b_assumePARqdValid)
Declare if it should be assumed (by hasRqdValues) that the required PrimitiveArray is (individually) valid and ready for comparison. See setAssumePAsValid for information.
Get with doAssumePARqdValid.
b_assumePARqdValid
- Should hasRqdValues assume that the required PrimitiveArray is individually valid? If true, yes. If false, no.public final boolean doAssumePARqdValid()
Should it be assumed (by hasRqdValues) that the required PrimitiveArray is (individually) valid and ready for comparison?
public final void setAssumePAActlValid(boolean b_assumePAActlValid)
Declare if it should be assumed (by hasRqdValues) that the actual PrimitiveArray is (individually) valid and ready for comparison. See setAssumePAsValid for information.
Get with doAssumePARqdValid.
b_assumePARqdValid
- Should hasRqdValues assume that the required PrimitiveArray is individually valid? If true, yes. If false, no.public final boolean doAssumePAActlValid()
Should it be assumed (by hasRqdValues) that the actual PrimitiveArray is (individually) valid and ready for comparison?
public boolean hasRqdValues(PrimitiveArray pa_rqd, PrimitiveArray pa_actual)
Are the actual values legal, according to both the rules in CAConfig and the "required" values?
Equal to hasRqdValues(null, null, null, pa_rqd, pa_actual)
public boolean hasRqdValues(String s_callingClsFnc, String s_rqdName, String s_actualName, PrimitiveArray pa_rqd, PrimitiveArray pa_actual)
Are the actual values legal, according to both the rules in CAConfig and the "required" values?
s_callingClsFnc
- The fully-qualified 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.CompareArrays.hasRqdValues
. If any of s_callingClsFnc, s_rqdName, or s_actualName are non-null, when this function would normally return false, it will instead throw an AssertException, with a descriptive error message.s_rqdName
- The descriptive name of pa_rqd, for potential error messages only.s_actualName
- The descriptive name of pa_actual, for potential error messages only.pa_rqd
- The required values. May not be null, nor a different type than pa_actual.pa_actual
- The actual values to analyze and validate. May not be null, nor a different type than pa_rqd.public void crashIfBadValues(PrimitiveArray pa_rqd, PrimitiveArray pa_actual)
If the actual values are illegal crash with an explanation. Otherwise do nothing.
Equal to crashIfBadValues("xbn.array.CompareArrays.crashIfBadValues", "pa_rqd" ,"pa_actual", pa_rqd, pa_actual)
public void crashIfBadValues(String s_callingClsFnc, String s_rqdName, String s_actualName, PrimitiveArray pa_rqd, PrimitiveArray pa_actual)
If the actual values are illegal crash with an explanation. Otherwise do nothing.
Equal to hasRqdValues("xbn.array.CompareArrays.crashIfBadValues", "pa_rqd" ,"pa_actual", pa_rqd, pa_actual)
(supressing the return value)
Before calling hasRqdValues, all string parameters are analyzed to ensure they are non-null and at least one character in length.
protected void throwAXBad(String s_callingClsFnc, String s_actualName, PrimitiveArray pa_rqd, PrimitiveArray pa_actual, String s_currently)
Used internally, by hasRqdValues. See the code for hasRqdValues.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava