public static int getBondTypeFromCode(char code) {
    switch (code) {
    case CODE_NONE:
      return TYPE_NONE;
    case CODE_SINGLE:
      return TYPE_SINGLE;
    case CODE_DOUBLE:
      return TYPE_DOUBLE;
    case CODE_TRIPLE:
      return TYPE_TRIPLE;
    case CODE_AROMATIC:
      return TYPE_AROMATIC;
    case CODE_DIRECTIONAL_1:
      return TYPE_DIRECTIONAL_1;
    case CODE_DIRECTIONAL_2:
      return TYPE_DIRECTIONAL_2;
    }
    return TYPE_UNKOWN;
  }