public final class CyclicOrganicMoleculeBuilder extends OrganicMoleculeBuilder
SSSS TTTTT OOO PPPP ! S T O O P P ! SSS T O O PPPP ! S T O O P ! SSSS T OOO P !Do not modify this class! Changes will be overwritten during official grading.
OrganicMoleculeBuilder.Substituent, OrganicMoleculeBuilder.SubstituentType
Constructor and Description |
---|
CyclicOrganicMoleculeBuilder(int setCycleLength)
Creates a builder for a cyclic molecule containing the given number of carbons in the ring.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finishBackbone(BondedAtom first,
BondedAtom[] firstBonds,
BondedAtom last,
BondedAtom[] lastBonds)
Makes the molecule cyclic by linking the first and last backbone carbons.
|
protected int |
freeValence(int position)
Gets how many bonds a core carbon can make after inclusion in the backbone.
|
addSubstituent, build, getCoreCarbons, getSubstituents
public CyclicOrganicMoleculeBuilder(int setCycleLength)
setCycleLength
- The number (at least 3) of carbons in the ring.protected void finishBackbone(BondedAtom first, BondedAtom[] firstBonds, BondedAtom last, BondedAtom[] lastBonds)
finishBackbone
in class OrganicMoleculeBuilder
first
- The first backbone carbon.firstBonds
- The first carbon's connected atoms.last
- The last backbone carbon.lastBonds
- The last carbon's connected atoms.protected int freeValence(int position)
freeValence
in class OrganicMoleculeBuilder
position
- The zero-based carbon index.