matches method
Returns whether the elements of this IntersectionMatrix
satisfies the required dimension symbols.
@param requiredDimensionSymbols nine dimension symbols with which to
compare the elements of this IntersectionMatrix
. Possible
values are {T, F, * , 0, 1, 2}
.
@return true
if this IntersectionMatrix
matches the required dimension symbols
Implementation
bool matches(String requiredDimensionSymbols) {
if (requiredDimensionSymbols.length != 9) {
throw ArgumentError("Should be length 9: $requiredDimensionSymbols");
}
for (int ai = 0; ai < 3; ai++) {
for (int bi = 0; bi < 3; bi++) {
if (!matchesDimValue(
matrix[ai][bi], requiredDimensionSymbols[3 * ai + bi])) {
return false;
}
}
}
return true;
}