test_class.declarator: sp = new SmilesParser(SilentChemObjectBuilder.getInstance())
test_class.modifier: private static
test_class.original_string: private static SmilesParser sp = new SmilesParser(SilentChemObjectBuilder.getInstance());
test_class.type: SmilesParser
test_class.var_name: sp
test_class.file: storage/smiles/src/test/java/org/openscience/cdk/smiles/SmilesParserTest.java
test_class.identifier: SmilesParserTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test public void onlyAgents() throws Exception {
          IReaction reaction = sp.parseReactionSmiles(">C>");
          Assert.assertEquals(0, reaction.getReactantCount());
          Assert.assertEquals(1, reaction.getAgents().getAtomContainerCount());
          Assert.assertEquals(0, reaction.getProductCount());
      }
test_case.class_method_signature: SmilesParserTest.onlyAgents()
test_case.full_signature: @Test public void onlyAgents()
test_case.identifier: onlyAgents
test_case.invocations: parseReactionSmiles assertEquals getReactantCount assertEquals getAtomContainerCount getAgents assertEquals getProductCount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void onlyAgents()
focal_class.declarator: logger = LoggingToolFactory.createLoggingTool(SmilesParser.class)
focal_class.modifier: private
focal_class.original_string: private ILoggingTool logger = LoggingToolFactory.createLoggingTool(SmilesParser.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.declarator: builder
focal_class.modifier: private final
focal_class.original_string: private final IChemObjectBuilder builder;
focal_class.type: IChemObjectBuilder
focal_class.var_name: builder
focal_class.declarator: beamToCDK
focal_class.modifier: private final
focal_class.original_string: private final BeamToCDK          beamToCDK;
focal_class.type: BeamToCDK
focal_class.var_name: beamToCDK
focal_class.declarator: kekulise = true
focal_class.modifier: private
focal_class.original_string: private boolean                  kekulise = true;
focal_class.type: boolean
focal_class.var_name: kekulise
focal_class.declarator: strict = false
focal_class.modifier: private
focal_class.original_string: private boolean                  strict = false;
focal_class.type: boolean
focal_class.var_name: strict
focal_class.file: storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java
focal_class.identifier: SmilesParser
focal_class.class_method_signature: SmilesParser.SmilesParser(final IChemObjectBuilder builder)
focal_class.full_signature: public  SmilesParser(final IChemObjectBuilder builder)
focal_class.identifier: SmilesParser
focal_class.modifiers: public
focal_class.parameters: (final IChemObjectBuilder builder)
focal_class.signature:  SmilesParser(final IChemObjectBuilder builder)
focal_class.class_method_signature: SmilesParser.setStrict(boolean strict)
focal_class.full_signature: public void setStrict(boolean strict)
focal_class.identifier: setStrict
focal_class.modifiers: public
focal_class.parameters: (boolean strict)
focal_class.return: void
focal_class.signature: void setStrict(boolean strict)
focal_class.class_method_signature: SmilesParser.parseReactionSmiles(String smiles)
focal_class.full_signature: public IReaction parseReactionSmiles(String smiles)
focal_class.identifier: parseReactionSmiles
focal_class.modifiers: public
focal_class.parameters: (String smiles)
focal_class.return: IReaction
focal_class.signature: IReaction parseReactionSmiles(String smiles)
focal_class.class_method_signature: SmilesParser.parseSmiles(String smiles)
focal_class.full_signature: public IAtomContainer parseSmiles(String smiles)
focal_class.identifier: parseSmiles
focal_class.modifiers: public
focal_class.parameters: (String smiles)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer parseSmiles(String smiles)
focal_class.class_method_signature: SmilesParser.parseSmiles(String smiles, boolean isRxnPart)
focal_class.full_signature: private IAtomContainer parseSmiles(String smiles, boolean isRxnPart)
focal_class.identifier: parseSmiles
focal_class.modifiers: private
focal_class.parameters: (String smiles, boolean isRxnPart)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer parseSmiles(String smiles, boolean isRxnPart)
focal_class.class_method_signature: SmilesParser.parseIntSafe(String val)
focal_class.full_signature: private int parseIntSafe(String val)
focal_class.identifier: parseIntSafe
focal_class.modifiers: private
focal_class.parameters: (String val)
focal_class.return: int
focal_class.signature: int parseIntSafe(String val)
focal_class.class_method_signature: SmilesParser.parseMolCXSMILES(String title, IAtomContainer mol)
focal_class.full_signature: private void parseMolCXSMILES(String title, IAtomContainer mol)
focal_class.identifier: parseMolCXSMILES
focal_class.modifiers: private
focal_class.parameters: (String title, IAtomContainer mol)
focal_class.return: void
focal_class.signature: void parseMolCXSMILES(String title, IAtomContainer mol)
focal_class.class_method_signature: SmilesParser.parseRxnCXSMILES(String title, IReaction rxn)
focal_class.full_signature: private void parseRxnCXSMILES(String title, IReaction rxn)
focal_class.identifier: parseRxnCXSMILES
focal_class.modifiers: private
focal_class.parameters: (String title, IReaction rxn)
focal_class.return: void
focal_class.signature: void parseRxnCXSMILES(String title, IReaction rxn)
focal_class.class_method_signature: SmilesParser.handleFragmentGrouping(IReaction rxn, CxSmilesState cxstate)
focal_class.full_signature: private void handleFragmentGrouping(IReaction rxn, CxSmilesState cxstate)
focal_class.identifier: handleFragmentGrouping
focal_class.modifiers: private
focal_class.parameters: (IReaction rxn, CxSmilesState cxstate)
focal_class.return: void
focal_class.signature: void handleFragmentGrouping(IReaction rxn, CxSmilesState cxstate)
focal_class.class_method_signature: SmilesParser.assignCxSmilesInfo(IChemObjectBuilder bldr,
                                      IChemObject chemObj,
                                      List<IAtom> atoms,
                                      Map<IAtom, IAtomContainer> atomToMol,
                                      CxSmilesState cxstate)
focal_class.full_signature: private void assignCxSmilesInfo(IChemObjectBuilder bldr,
                                      IChemObject chemObj,
                                      List<IAtom> atoms,
                                      Map<IAtom, IAtomContainer> atomToMol,
                                      CxSmilesState cxstate)
focal_class.identifier: assignCxSmilesInfo
focal_class.modifiers: private
focal_class.parameters: (IChemObjectBuilder bldr,
                                      IChemObject chemObj,
                                      List<IAtom> atoms,
                                      Map<IAtom, IAtomContainer> atomToMol,
                                      CxSmilesState cxstate)
focal_class.return: void
focal_class.signature: void assignCxSmilesInfo(IChemObjectBuilder bldr,
                                      IChemObject chemObj,
                                      List<IAtom> atoms,
                                      Map<IAtom, IAtomContainer> atomToMol,
                                      CxSmilesState cxstate)
focal_class.class_method_signature: SmilesParser.setPreservingAromaticity(boolean preservingAromaticity)
focal_class.full_signature: @Deprecated public void setPreservingAromaticity(boolean preservingAromaticity)
focal_class.identifier: setPreservingAromaticity
focal_class.modifiers: @Deprecated public
focal_class.parameters: (boolean preservingAromaticity)
focal_class.return: void
focal_class.signature: void setPreservingAromaticity(boolean preservingAromaticity)
focal_class.class_method_signature: SmilesParser.isPreservingAromaticity()
focal_class.full_signature: @Deprecated public boolean isPreservingAromaticity()
focal_class.identifier: isPreservingAromaticity
focal_class.modifiers: @Deprecated public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isPreservingAromaticity()
focal_class.class_method_signature: SmilesParser.kekulise(boolean kekulise)
focal_class.full_signature: public void kekulise(boolean kekulise)
focal_class.identifier: kekulise
focal_class.modifiers: public
focal_class.parameters: (boolean kekulise)
focal_class.return: void
focal_class.signature: void kekulise(boolean kekulise)
focal_method.body: public IReaction parseReactionSmiles(String smiles) throws InvalidSmilesException {
  
          if (!smiles.contains(">"))
              throw new InvalidSmilesException("Not a reaction SMILES: " + smiles);
  
          final int first  = smiles.indexOf('>');
          final int second = smiles.indexOf('>', first + 1);
  
          if (second < 0)
              throw new InvalidSmilesException("Invalid reaction SMILES:" + smiles);
  
          final String reactants = smiles.substring(0, first);
          final String agents = smiles.substring(first + 1, second);
          final String products = smiles.substring(second + 1, smiles.length());
  
          IReaction reaction = builder.newInstance(IReaction.class);
  
          // add reactants
          if (!reactants.isEmpty()) {
              IAtomContainer reactantContainer = parseSmiles(reactants, true);
              IAtomContainerSet reactantSet = ConnectivityChecker.partitionIntoMolecules(reactantContainer);
              for (int i = 0; i < reactantSet.getAtomContainerCount(); i++) {
                  reaction.addReactant(reactantSet.getAtomContainer(i));
              }
          }
  
          // add agents
          if (!agents.isEmpty()) {
              IAtomContainer agentContainer = parseSmiles(agents, true);
              IAtomContainerSet agentSet = ConnectivityChecker.partitionIntoMolecules(agentContainer);
              for (int i = 0; i < agentSet.getAtomContainerCount(); i++) {
                  reaction.addAgent(agentSet.getAtomContainer(i));
              }
          }
  
          String title = null;
  
          // add products
          if (!products.isEmpty()) {
              IAtomContainer productContainer = parseSmiles(products, true);
              IAtomContainerSet productSet = ConnectivityChecker.partitionIntoMolecules(productContainer);
              for (int i = 0; i < productSet.getAtomContainerCount(); i++) {
                  reaction.addProduct(productSet.getAtomContainer(i));
              }
              reaction.setProperty(CDKConstants.TITLE, title = productContainer.getProperty(CDKConstants.TITLE));
          }
  
          try {
              // CXSMILES layer
              parseRxnCXSMILES(title, reaction);
          } catch (Exception e) {
              e.printStackTrace();
              throw new InvalidSmilesException("Error parsing CXSMILES:" + e.getMessage());
          }
  
          return reaction;
      }
focal_method.class_method_signature: SmilesParser.parseReactionSmiles(String smiles)
focal_method.full_signature: public IReaction parseReactionSmiles(String smiles)
focal_method.identifier: parseReactionSmiles
focal_method.invocations: contains indexOf indexOf substring substring substring length newInstance isEmpty parseSmiles partitionIntoMolecules getAtomContainerCount addReactant getAtomContainer isEmpty parseSmiles partitionIntoMolecules getAtomContainerCount addAgent getAtomContainer isEmpty parseSmiles partitionIntoMolecules getAtomContainerCount addProduct getAtomContainer setProperty getProperty parseRxnCXSMILES printStackTrace getMessage
focal_method.modifiers: public
focal_method.parameters: (String smiles)
focal_method.return: IReaction
focal_method.signature: IReaction parseReactionSmiles(String smiles)