test_class.file: storage/io/src/test/java/org/openscience/cdk/io/program/Mopac7WriterTest.java
test_class.identifier: Mopac7WriterTest
test_class.superclass: extends ChemObjectWriterTest
test_case.body: @Test
      public void testWrite() throws Exception {
          StringWriter strWriter = new StringWriter();
          Mopac7Writer writer = new Mopac7Writer(strWriter);
  
          IAtomContainer mol = new AtomContainer();
          mol.addAtom(new Atom("Cr"));
          writer.write(mol);
          writer.close();
  
          Assert.assertTrue(strWriter.toString().contains("PM3"));
          Assert.assertTrue(strWriter.toString().contains("Cr "));
          Assert.assertTrue(strWriter.toString().contains("Generated by"));
      }
test_case.class_method_signature: Mopac7WriterTest.testWrite()
test_case.full_signature: @Test public void testWrite()
test_case.identifier: testWrite
test_case.invocations: addAtom write close assertTrue contains toString assertTrue contains toString assertTrue contains toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWrite()
focal_class.declarator: writer
focal_class.modifier: private
focal_class.original_string: private BufferedWriter      writer;
focal_class.type: BufferedWriter
focal_class.var_name: writer
focal_class.declarator: logger = LoggingToolFactory.createLoggingTool(Mopac7Writer.class)
focal_class.modifier: private static
focal_class.original_string: private static ILoggingTool logger = LoggingToolFactory.createLoggingTool(Mopac7Writer.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.declarator: BLANK  = ' '
focal_class.modifier: private final static
focal_class.original_string: private final static char   BLANK  = ' ';
focal_class.type: char
focal_class.var_name: BLANK
focal_class.declarator: numberFormat
focal_class.modifier: private
focal_class.original_string: private NumberFormat        numberFormat;
focal_class.type: NumberFormat
focal_class.var_name: numberFormat
focal_class.declarator: mopacCommands
focal_class.modifier: private
focal_class.original_string: private StringIOSetting  mopacCommands;
focal_class.type: StringIOSetting
focal_class.var_name: mopacCommands
focal_class.declarator: optimize
focal_class.modifier: private
focal_class.original_string: private BooleanIOSetting optimize;
focal_class.type: BooleanIOSetting
focal_class.var_name: optimize
focal_class.file: storage/io/src/main/java/org/openscience/cdk/io/program/Mopac7Writer.java
focal_class.identifier: Mopac7Writer
focal_class.class_method_signature: Mopac7Writer.Mopac7Writer()
focal_class.full_signature: public  Mopac7Writer()
focal_class.identifier: Mopac7Writer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  Mopac7Writer()
focal_class.class_method_signature: Mopac7Writer.Mopac7Writer(OutputStream out)
focal_class.full_signature: public  Mopac7Writer(OutputStream out)
focal_class.identifier: Mopac7Writer
focal_class.modifiers: public
focal_class.parameters: (OutputStream out)
focal_class.signature:  Mopac7Writer(OutputStream out)
focal_class.class_method_signature: Mopac7Writer.Mopac7Writer(Writer out)
focal_class.full_signature: public  Mopac7Writer(Writer out)
focal_class.identifier: Mopac7Writer
focal_class.modifiers: public
focal_class.parameters: (Writer out)
focal_class.signature:  Mopac7Writer(Writer out)
focal_class.class_method_signature: Mopac7Writer.write(IChemObject arg0)
focal_class.full_signature: @Override public synchronized void write(IChemObject arg0)
focal_class.identifier: write
focal_class.modifiers: @Override public synchronized
focal_class.parameters: (IChemObject arg0)
focal_class.return: void
focal_class.signature: void write(IChemObject arg0)
focal_class.class_method_signature: Mopac7Writer.writeAtom(IAtom atom, double xCoord, double yCoord, double zCoord, int optimize)
focal_class.full_signature: private void writeAtom(IAtom atom, double xCoord, double yCoord, double zCoord, int optimize)
focal_class.identifier: writeAtom
focal_class.modifiers: private
focal_class.parameters: (IAtom atom, double xCoord, double yCoord, double zCoord, int optimize)
focal_class.return: void
focal_class.signature: void writeAtom(IAtom atom, double xCoord, double yCoord, double zCoord, int optimize)
focal_class.class_method_signature: Mopac7Writer.close()
focal_class.full_signature: @Override /** {@inheritDoc} */ public void close()
focal_class.identifier: close
focal_class.modifiers: @Override /** {@inheritDoc} */ public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: Mopac7Writer.accepts(Class<? extends IChemObject> classObject)
focal_class.full_signature: @Override /** {@inheritDoc} */ public boolean accepts(Class<? extends IChemObject> classObject)
focal_class.identifier: accepts
focal_class.modifiers: @Override /** {@inheritDoc} */ public
focal_class.parameters: (Class<? extends IChemObject> classObject)
focal_class.return: boolean
focal_class.signature: boolean accepts(Class<? extends IChemObject> classObject)
focal_class.class_method_signature: Mopac7Writer.getFormat()
focal_class.full_signature: @Override /** {@inheritDoc} */ public IResourceFormat getFormat()
focal_class.identifier: getFormat
focal_class.modifiers: @Override /** {@inheritDoc} */ public
focal_class.parameters: ()
focal_class.return: IResourceFormat
focal_class.signature: IResourceFormat getFormat()
focal_class.class_method_signature: Mopac7Writer.setWriter(OutputStream writer)
focal_class.full_signature: @Override /** {@inheritDoc} */ public void setWriter(OutputStream writer)
focal_class.identifier: setWriter
focal_class.modifiers: @Override /** {@inheritDoc} */ public
focal_class.parameters: (OutputStream writer)
focal_class.return: void
focal_class.signature: void setWriter(OutputStream writer)
focal_class.class_method_signature: Mopac7Writer.setWriter(Writer writer)
focal_class.full_signature: @Override /** {@inheritDoc} */ public void setWriter(Writer writer)
focal_class.identifier: setWriter
focal_class.modifiers: @Override /** {@inheritDoc} */ public
focal_class.parameters: (Writer writer)
focal_class.return: void
focal_class.signature: void setWriter(Writer writer)
focal_class.class_method_signature: Mopac7Writer.getTitle()
focal_class.full_signature: private String getTitle()
focal_class.identifier: getTitle
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getTitle()
focal_class.class_method_signature: Mopac7Writer.initIOSettings()
focal_class.full_signature: private void initIOSettings()
focal_class.identifier: initIOSettings
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void initIOSettings()
focal_class.class_method_signature: Mopac7Writer.customizeJob()
focal_class.full_signature: private void customizeJob()
focal_class.identifier: customizeJob
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void customizeJob()
focal_class.superclass: extends DefaultChemObjectWriter
focal_method.body: @Override
      public synchronized void write(IChemObject arg0) throws CDKException {
          customizeJob();
          if (arg0 instanceof IAtomContainer)
              try {
                  IAtomContainer container = (IAtomContainer) arg0;
                  writer.write(mopacCommands.getSetting());
                  int formalCharge = AtomContainerManipulator.getTotalFormalCharge(container);
                  if (formalCharge != 0) writer.write(" CHARGE=" + formalCharge);
                  writer.write('\n');
                  if (container.getProperty("Names") != null) writer.write(container.getProperty("Names").toString());
                  writer.write('\n');
                  writer.write(getTitle());
                  writer.write('\n');
  
                  for (int i = 0; i < container.getAtomCount(); i++) {
                      IAtom atom = container.getAtom(i);
                      if (atom.getPoint3d() != null) {
                          Point3d point = atom.getPoint3d();
                          writeAtom(atom, point.x, point.y, point.z, optimize.isSet() ? 1 : 0);
                      } else if (atom.getPoint2d() != null) {
                          Point2d point = atom.getPoint2d();
                          writeAtom(atom, point.x, point.y, 0, optimize.isSet() ? 1 : 0);
                      } else
                          writeAtom(atom, 0, 0, 0, 1);
                  }
                  writer.write("0");
                  writer.write('\n');
  
              } catch (IOException ioException) {
                  logger.error(ioException);
                  throw new CDKException(ioException.getMessage(), ioException);
              }
          else
              throw new CDKException("Unsupported object!\t" + arg0.getClass().getName());
      }
focal_method.class_method_signature: Mopac7Writer.write(IChemObject arg0)
focal_method.full_signature: @Override public synchronized void write(IChemObject arg0)
focal_method.identifier: write
focal_method.invocations: customizeJob write getSetting getTotalFormalCharge write write getProperty write toString getProperty write write getTitle write getAtomCount getAtom getPoint3d getPoint3d writeAtom isSet getPoint2d getPoint2d writeAtom isSet writeAtom write write error getMessage getName getClass
focal_method.modifiers: @Override public synchronized
focal_method.parameters: (IChemObject arg0)
focal_method.return: void
focal_method.signature: void write(IChemObject arg0)