コード例 #1
0
  private Molecule createCyclooctane() {
    Molecule result = createOctane();

    result.connect(result.getAtom(0), result.getAtom(7), 1);

    return result;
  }
コード例 #2
0
  private Molecule createEthene() {
    Molecule result = new DefaultMolecule();

    result.connect(result.addAtom("C"), result.addAtom("C"), 2);

    return result;
  }
コード例 #3
0
  private Molecule createXylene() {
    Molecule result = Molecules.createCyclohexane();
    result.getBond(result.getAtom(0), result.getAtom(1)).setType(2);
    result.getBond(result.getAtom(2), result.getAtom(3)).setType(2);
    result.getBond(result.getAtom(4), result.getAtom(5)).setType(2);

    result.connect(result.getAtom(0), result.addAtom("C"), 1);
    result.connect(result.getAtom(5), result.addAtom("C"), 1);

    return result;
  }
コード例 #4
0
  private Molecule createOctane() {
    Molecule result = new DefaultMolecule();
    Atom first = result.addAtom("C");

    for (int i = 0; i < 7; i++) {
      Atom next = result.addAtom("C");
      result.connect(first, next, 1);

      first = next;
    }

    return result;
  }
コード例 #5
0
  private Molecule createEthyne() {
    Molecule result = createEthene();
    result.getBond(0).setType(3);

    return result;
  }