class Mopac7Writer extends DefaultChemObjectWriter {

    @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());
    }

    public  Mopac7Writer();
    public  Mopac7Writer(OutputStream out);
    public  Mopac7Writer(Writer out);

}