matchesDimValue static method
Tests if the dimension value satisfies the dimension symbol.
@param actualDimensionValue a number that can be stored in the IntersectionMatrix
. Possible values are {TRUE, FALSE, DONTCARE, 0, 1, 2}
.
@param requiredDimensionSymbol a character used in the string
representation of an IntersectionMatrix
. Possible values
are {T, F, * , 0, 1, 2}
.
@return true if the dimension symbol matches
the dimension value
Implementation
static bool matchesDimValue(
int actualDimensionValue, String requiredDimensionSymbol) {
if (requiredDimensionSymbol == Dimension.SYM_DONTCARE) {
return true;
}
if (requiredDimensionSymbol == Dimension.SYM_TRUE &&
(actualDimensionValue >= 0 || actualDimensionValue == Dimension.TRUE)) {
return true;
}
if (requiredDimensionSymbol == Dimension.SYM_FALSE &&
actualDimensionValue == Dimension.FALSE) {
return true;
}
if (requiredDimensionSymbol == Dimension.SYM_P &&
actualDimensionValue == Dimension.P) {
return true;
}
if (requiredDimensionSymbol == Dimension.SYM_L &&
actualDimensionValue == Dimension.L) {
return true;
}
if (requiredDimensionSymbol == Dimension.SYM_A &&
actualDimensionValue == Dimension.A) {
return true;
}
return false;
}