toDimensionValue static method

int toDimensionValue(
  1. String dimensionSymbol
)

Converts the dimension symbol to a dimension value, for example, '*' => DONTCARE .

@param dimensionSymbol a character for use in the string representation of an IntersectionMatrix. Possible values are {T, F, * , 0, 1, 2} . @return a number that can be stored in the IntersectionMatrix . Possible values are {TRUE, FALSE, DONTCARE, 0, 1, 2}.

Implementation

static int toDimensionValue(String dimensionSymbol) {
  switch (dimensionSymbol.toUpperCase()) {
    case SYM_FALSE:
      return FALSE;
    case SYM_TRUE:
      return TRUE;
    case SYM_DONTCARE:
      return DONTCARE;
    case SYM_P:
      return P;
    case SYM_L:
      return L;
    case SYM_A:
      return A;
  }
  throw ArgumentError("Unknown dimension symbol: $dimensionSymbol");
}