test_class.file: tool/forcefield/src/test/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMappingTest.java
test_class.identifier: MmffAromaticTypeMappingTest
test_case.body: @Test
      public void benzeneIsAromatic() {
          int[] cycle = new int[]{0, 1, 2, 3, 4, 5, 0};
          int[] contr = new int[]{1, 1, 1, 1, 1, 1};
          int[] dbs = new int[]{1, 0, 3, 2, 5, 4};
          boolean[] arom = new boolean[contr.length];
          Assert.assertTrue(MmffAromaticTypeMapping.isAromaticRing(cycle, contr, dbs, arom));
      }
test_case.class_method_signature: MmffAromaticTypeMappingTest.benzeneIsAromatic()
test_case.full_signature: @Test public void benzeneIsAromatic()
test_case.identifier: benzeneIsAromatic
test_case.invocations: assertTrue isAromaticRing
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void benzeneIsAromatic()
focal_class.declarator: hetroTypes = ImmutableMap.<String, String>builder().put("S", STHI)
                                                                 .put("-O-", OFUR).put("OC=C", OFUR).put("OC=N", OFUR)
                                                                 .put(NCN_PLUS, NIM_PLUS).put(NGD_PLUS, NIM_PLUS)
                                                                 .put("NM", N5M).put("NC=C", NPYL).put("NC=N", NPYL).put("NN=N", NPYL)
                                                                 .put("NC=O", NPYL).put("NC=S", NPYL).put("NSO2", NPYL)
                                                                 .put("NR", NPYL).build()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, String> hetroTypes = ImmutableMap.<String, String>builder().put("S", STHI)
                                                                 .put("-O-", OFUR).put("OC=C", OFUR).put("OC=N", OFUR)
                                                                 .put(NCN_PLUS, NIM_PLUS).put(NGD_PLUS, NIM_PLUS)
                                                                 .put("NM", N5M).put("NC=C", NPYL).put("NC=N", NPYL).put("NN=N", NPYL)
                                                                 .put("NC=O", NPYL).put("NC=S", NPYL).put("NSO2", NPYL)
                                                                 .put("NR", NPYL).build();
focal_class.type: Map<String, String>
focal_class.var_name: hetroTypes
focal_class.declarator: alphaTypes = ImmutableMap.<String, String> builder().put("CNN+", CIM_PLUS)
                                                           .put("CGD+", CIM_PLUS).put("C=C", C5A).put("C=N", C5A)
                                                           .put("CGD", C5A).put("CB", C5A).put(C5B, C5).put("N2OX", N5AX)
                                                           .put(NCN_PLUS, NIM_PLUS).put(NGD_PLUS, NIM_PLUS)
                                                           .put("N+=C", N5A_PLUS).put("N+=N", N5A_PLUS)
                                                           .put("NPD+", N5A_PLUS).put("N=C", N5A).put("N=N", N5A).build()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, String> alphaTypes = ImmutableMap.<String, String> builder().put("CNN+", CIM_PLUS)
                                                           .put("CGD+", CIM_PLUS).put("C=C", C5A).put("C=N", C5A)
                                                           .put("CGD", C5A).put("CB", C5A).put(C5B, C5).put("N2OX", N5AX)
                                                           .put(NCN_PLUS, NIM_PLUS).put(NGD_PLUS, NIM_PLUS)
                                                           .put("N+=C", N5A_PLUS).put("N+=N", N5A_PLUS)
                                                           .put("NPD+", N5A_PLUS).put("N=C", N5A).put("N=N", N5A).build();
focal_class.type: Map<String, String>
focal_class.var_name: alphaTypes
focal_class.declarator: betaTypes  = ImmutableMap.<String, String> builder().put("CNN+", CIM_PLUS)
                                                           .put("CGD+", CIM_PLUS).put("C=C", C5B).put("C=N", C5B)
                                                           .put("CGD", C5B).put("CB", C5B).put(C5A, C5).put("N2OX", N5BX)
                                                           .put(NCN_PLUS, NIM_PLUS).put(NGD_PLUS, NIM_PLUS)
                                                           .put("N+=C", N5B_PLUS).put("N+=N", N5B_PLUS)
                                                           .put("NPD+", N5B_PLUS).put("N=C", N5B).put("N=N", N5B).build()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, String> betaTypes  = ImmutableMap.<String, String> builder().put("CNN+", CIM_PLUS)
                                                           .put("CGD+", CIM_PLUS).put("C=C", C5B).put("C=N", C5B)
                                                           .put("CGD", C5B).put("CB", C5B).put(C5A, C5).put("N2OX", N5BX)
                                                           .put(NCN_PLUS, NIM_PLUS).put(NGD_PLUS, NIM_PLUS)
                                                           .put("N+=C", N5B_PLUS).put("N+=N", N5B_PLUS)
                                                           .put("NPD+", N5B_PLUS).put("N=C", N5B).put("N=N", N5B).build();
focal_class.type: Map<String, String>
focal_class.var_name: betaTypes
focal_class.declarator: C5         = "C5"
focal_class.modifier: @SuppressWarnings("PMD.ShortVariable")
      // C5 is intended
      private static final
focal_class.original_string: @SuppressWarnings("PMD.ShortVariable")
      // C5 is intended
      private static final String       C5         = "C5";
focal_class.type: String
focal_class.var_name: C5
focal_class.declarator: C5A        = "C5A"
focal_class.modifier: private static final
focal_class.original_string: private static final String       C5A        = "C5A";
focal_class.type: String
focal_class.var_name: C5A
focal_class.declarator: C5B        = "C5B"
focal_class.modifier: private static final
focal_class.original_string: private static final String       C5B        = "C5B";
focal_class.type: String
focal_class.var_name: C5B
focal_class.declarator: N5A        = "N5A"
focal_class.modifier: private static final
focal_class.original_string: private static final String       N5A        = "N5A";
focal_class.type: String
focal_class.var_name: N5A
focal_class.declarator: N5B        = "N5B"
focal_class.modifier: private static final
focal_class.original_string: private static final String       N5B        = "N5B";
focal_class.type: String
focal_class.var_name: N5B
focal_class.declarator: NPYL       = "NPYL"
focal_class.modifier: private static final
focal_class.original_string: private static final String       NPYL       = "NPYL";
focal_class.type: String
focal_class.var_name: NPYL
focal_class.declarator: NCN_PLUS   = "NCN+"
focal_class.modifier: private static final
focal_class.original_string: private static final String       NCN_PLUS   = "NCN+";
focal_class.type: String
focal_class.var_name: NCN_PLUS
focal_class.declarator: NGD_PLUS   = "NGD+"
focal_class.modifier: private static final
focal_class.original_string: private static final String       NGD_PLUS   = "NGD+";
focal_class.type: String
focal_class.var_name: NGD_PLUS
focal_class.declarator: NIM_PLUS   = "NIM+"
focal_class.modifier: private static final
focal_class.original_string: private static final String       NIM_PLUS   = "NIM+";
focal_class.type: String
focal_class.var_name: NIM_PLUS
focal_class.declarator: N5A_PLUS   = "N5A+"
focal_class.modifier: private static final
focal_class.original_string: private static final String       N5A_PLUS   = "N5A+";
focal_class.type: String
focal_class.var_name: N5A_PLUS
focal_class.declarator: N5B_PLUS   = "N5B+"
focal_class.modifier: private static final
focal_class.original_string: private static final String       N5B_PLUS   = "N5B+";
focal_class.type: String
focal_class.var_name: N5B_PLUS
focal_class.declarator: N5M        = "N5M"
focal_class.modifier: private static final
focal_class.original_string: private static final String       N5M        = "N5M";
focal_class.type: String
focal_class.var_name: N5M
focal_class.declarator: N5AX       = "N5AX"
focal_class.modifier: private static final
focal_class.original_string: private static final String       N5AX       = "N5AX";
focal_class.type: String
focal_class.var_name: N5AX
focal_class.declarator: N5BX       = "N5BX"
focal_class.modifier: private static final
focal_class.original_string: private static final String       N5BX       = "N5BX";
focal_class.type: String
focal_class.var_name: N5BX
focal_class.declarator: CIM_PLUS   = "CIM+"
focal_class.modifier: private static final
focal_class.original_string: private static final String       CIM_PLUS   = "CIM+";
focal_class.type: String
focal_class.var_name: CIM_PLUS
focal_class.declarator: OFUR       = "OFUR"
focal_class.modifier: private static final
focal_class.original_string: private static final String       OFUR       = "OFUR";
focal_class.type: String
focal_class.var_name: OFUR
focal_class.declarator: STHI       = "STHI"
focal_class.modifier: private static final
focal_class.original_string: private static final String       STHI       = "STHI";
focal_class.type: String
focal_class.var_name: STHI
focal_class.file: tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java
focal_class.identifier: MmffAromaticTypeMapping
focal_class.class_method_signature: MmffAromaticTypeMapping.MmffAromaticTypeMapping()
focal_class.full_signature:   MmffAromaticTypeMapping()
focal_class.identifier: MmffAromaticTypeMapping
focal_class.parameters: ()
focal_class.signature:  MmffAromaticTypeMapping()
focal_class.class_method_signature: MmffAromaticTypeMapping.assign(IAtomContainer container, String[] symbs, EdgeToBondMap bonds, int[][] graph, Set<IBond> mmffArom)
focal_class.full_signature:  void assign(IAtomContainer container, String[] symbs, EdgeToBondMap bonds, int[][] graph, Set<IBond> mmffArom)
focal_class.identifier: assign
focal_class.parameters: (IAtomContainer container, String[] symbs, EdgeToBondMap bonds, int[][] graph, Set<IBond> mmffArom)
focal_class.return: void
focal_class.signature: void assign(IAtomContainer container, String[] symbs, EdgeToBondMap bonds, int[][] graph, Set<IBond> mmffArom)
focal_class.class_method_signature: MmffAromaticTypeMapping.findAromaticRings(int[][] cycles, int[] contribution, int[] dbs)
focal_class.full_signature: private static int[][] findAromaticRings(int[][] cycles, int[] contribution, int[] dbs)
focal_class.identifier: findAromaticRings
focal_class.modifiers: private static
focal_class.parameters: (int[][] cycles, int[] contribution, int[] dbs)
focal_class.return: int[][]
focal_class.signature: int[][] findAromaticRings(int[][] cycles, int[] contribution, int[] dbs)
focal_class.class_method_signature: MmffAromaticTypeMapping.isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic)
focal_class.full_signature: static boolean isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic)
focal_class.identifier: isAromaticRing
focal_class.modifiers: static
focal_class.parameters: (int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic)
focal_class.return: boolean
focal_class.signature: boolean isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic)
focal_class.class_method_signature: MmffAromaticTypeMapping.updateAromaticTypesInSixMemberRing(int[] cycle, String[] symbs)
focal_class.full_signature: static void updateAromaticTypesInSixMemberRing(int[] cycle, String[] symbs)
focal_class.identifier: updateAromaticTypesInSixMemberRing
focal_class.modifiers: static
focal_class.parameters: (int[] cycle, String[] symbs)
focal_class.return: void
focal_class.signature: void updateAromaticTypesInSixMemberRing(int[] cycle, String[] symbs)
focal_class.class_method_signature: MmffAromaticTypeMapping.updateAromaticTypesInFiveMemberRing(int[] cycle, String[] symbs)
focal_class.full_signature: private void updateAromaticTypesInFiveMemberRing(int[] cycle, String[] symbs)
focal_class.identifier: updateAromaticTypesInFiveMemberRing
focal_class.modifiers: private
focal_class.parameters: (int[] cycle, String[] symbs)
focal_class.return: void
focal_class.signature: void updateAromaticTypesInFiveMemberRing(int[] cycle, String[] symbs)
focal_class.class_method_signature: MmffAromaticTypeMapping.getAlphaAromaticType(String symb, boolean imidazolium, boolean anion)
focal_class.full_signature: private String getAlphaAromaticType(String symb, boolean imidazolium, boolean anion)
focal_class.identifier: getAlphaAromaticType
focal_class.modifiers: private
focal_class.parameters: (String symb, boolean imidazolium, boolean anion)
focal_class.return: String
focal_class.signature: String getAlphaAromaticType(String symb, boolean imidazolium, boolean anion)
focal_class.class_method_signature: MmffAromaticTypeMapping.getBetaAromaticType(String symb, boolean imidazolium, boolean anion)
focal_class.full_signature: private String getBetaAromaticType(String symb, boolean imidazolium, boolean anion)
focal_class.identifier: getBetaAromaticType
focal_class.modifiers: private
focal_class.parameters: (String symb, boolean imidazolium, boolean anion)
focal_class.return: String
focal_class.signature: String getBetaAromaticType(String symb, boolean imidazolium, boolean anion)
focal_class.class_method_signature: MmffAromaticTypeMapping.getAromaticType(Map<String, String> map, char suffix, String symb, boolean imidazolium, boolean anion)
focal_class.full_signature: static String getAromaticType(Map<String, String> map, char suffix, String symb, boolean imidazolium, boolean anion)
focal_class.identifier: getAromaticType
focal_class.modifiers: static
focal_class.parameters: (Map<String, String> map, char suffix, String symb, boolean imidazolium, boolean anion)
focal_class.return: String
focal_class.signature: String getAromaticType(Map<String, String> map, char suffix, String symb, boolean imidazolium, boolean anion)
focal_class.class_method_signature: MmffAromaticTypeMapping.indexOfHetro(int[] cycle, int[] contribution)
focal_class.full_signature: static int indexOfHetro(int[] cycle, int[] contribution)
focal_class.identifier: indexOfHetro
focal_class.modifiers: static
focal_class.parameters: (int[] cycle, int[] contribution)
focal_class.return: int
focal_class.signature: int indexOfHetro(int[] cycle, int[] contribution)
focal_class.class_method_signature: MmffAromaticTypeMapping.normaliseCycle(int[] cycle, int[] contribution)
focal_class.full_signature: static boolean normaliseCycle(int[] cycle, int[] contribution)
focal_class.identifier: normaliseCycle
focal_class.modifiers: static
focal_class.parameters: (int[] cycle, int[] contribution)
focal_class.return: boolean
focal_class.signature: boolean normaliseCycle(int[] cycle, int[] contribution)
focal_class.class_method_signature: MmffAromaticTypeMapping.contribution(int elem, int x, int v)
focal_class.full_signature: @SuppressWarnings("PMD.CyclomaticComplexity") // high complexity but clean static int contribution(int elem, int x, int v)
focal_class.identifier: contribution
focal_class.modifiers: @SuppressWarnings("PMD.CyclomaticComplexity") // high complexity but clean static
focal_class.parameters: (int elem, int x, int v)
focal_class.return: int
focal_class.signature: int contribution(int elem, int x, int v)
focal_class.class_method_signature: MmffAromaticTypeMapping.cyclesOfSizeFiveOrSix(IAtomContainer container, int[][] graph)
focal_class.full_signature: static int[][] cyclesOfSizeFiveOrSix(IAtomContainer container, int[][] graph)
focal_class.identifier: cyclesOfSizeFiveOrSix
focal_class.modifiers: static
focal_class.parameters: (IAtomContainer container, int[][] graph)
focal_class.return: int[][]
focal_class.signature: int[][] cyclesOfSizeFiveOrSix(IAtomContainer container, int[][] graph)
focal_class.class_method_signature: MmffAromaticTypeMapping.setupContributionAndDoubleBonds(IAtomContainer molecule, EdgeToBondMap bonds, int[][] graph,
              int[] contribution, int[] dbs)
focal_class.full_signature: private static void setupContributionAndDoubleBonds(IAtomContainer molecule, EdgeToBondMap bonds, int[][] graph,
              int[] contribution, int[] dbs)
focal_class.identifier: setupContributionAndDoubleBonds
focal_class.modifiers: private static
focal_class.parameters: (IAtomContainer molecule, EdgeToBondMap bonds, int[][] graph,
              int[] contribution, int[] dbs)
focal_class.return: void
focal_class.signature: void setupContributionAndDoubleBonds(IAtomContainer molecule, EdgeToBondMap bonds, int[][] graph,
              int[] contribution, int[] dbs)
focal_method.body: static boolean isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic) {
  
          int len = cycle.length - 1;
          int sum = 0;
  
          int i = 0;
          int iPrev = len - 1;
          int iNext = 1;
  
          while (i < len) {
  
              int prev = cycle[iPrev];
              int curr = cycle[i];
              int next = cycle[iNext];
  
              int pElectrons = contribution[curr];
  
              if (pElectrons < 0) return false;
  
              // single p electrons are only donated from double bonds, these are
              // only counted if the bonds are either in this ring or the bond
              // is aromatic
              if (pElectrons == 1) {
                  final int other = dbs[curr];
                  if (other < 0) return false;
                  if (other != prev && other != next && !aromatic[other]) return false;
              }
  
              iPrev = i;
              i = iNext;
              iNext = iNext + 1;
              sum += pElectrons;
          }
  
          // the sum of electrons 4n+2?
          return (sum - 2) % 4 == 0;
      }
focal_method.class_method_signature: MmffAromaticTypeMapping.isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic)
focal_method.full_signature: static boolean isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic)
focal_method.identifier: isAromaticRing
focal_method.modifiers: static
focal_method.parameters: (int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic)
focal_method.return: boolean
focal_method.signature: boolean isAromaticRing(int[] cycle, int[] contribution, int[] dbs, boolean[] aromatic)